LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-02-2011, 08:12 AM   #1
raphaelmsx
LQ Newbie
 
Registered: Jul 2006
Posts: 10

Rep: Reputation: 0
Running GUI commands in console without locking it


Hi!

How to run GUI commands in console without locking it?

For example, I just installed Skype in CentOS, and to run it, I type "skype" in the console, but then the prompt doesn't returns until I quit the application (either with control+c or quit in the app itself).

Thanks.
 
Old 11-02-2011, 08:28 AM   #2
translator1111
Member
 
Registered: Jun 2010
Location: Slovakia
Distribution: Debian 8, Ubuntu 10.04 and 12.04; SLAX 6.0; ConnochaetOS 0.9.; LFS; Natty chip: VT1708S
Posts: 93
Blog Entries: 2

Rep: Reputation: 7
Hello rapahelmsx,
I am afraid that you are right. When you type "skype" in the console, the prompt does not return until you quit the application. However you can open another console in several ways:
1. from the console you typed "skype" you go to the menu and open a new console terminal, "new tab"
2. form the GUI menu you can open a new terminal console
3. using [CTRL]+[ALT]+[F1-7]
Hopefully, this can help
P.S: the reason why this console is blocked while you are skype-ing is that this is the bridge between the application and your computer it works as the GUI application, it will be close when you clik the X at the window.
 
Old 11-02-2011, 08:38 AM   #3
Juako
Member
 
Registered: Mar 2010
Posts: 202

Rep: Reputation: 84
Add an ampersand ( '&' ) after the command:

Code:
me@localhost:~$skype &
The shell will execute the program in the background. If you want to bring it back to foreground, type "fg". If you want to send to background a program that is already in the foreground, you first stop it with "ctrl+z" and type "bg".

This is all documented in the bash manual (man bash), press "/" and search "JOB CONTROL".

Note that you will still get messages from that program in the console, if you don't want that you could close its standard output and standard error:

Code:
me@localhost:~$skype >&- 2>&-
Here, ">&-" closes standard output and "2>&-" closes standard error. I think there's a way to close both descriptors with one redirection but I don't know the syntax.

Similarly, this is documented in the bash manual in the section "REDIRECTION".

Last edited by Juako; 11-02-2011 at 09:05 AM.
 
Old 11-02-2011, 02:05 PM   #4
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Another recommendation is to prepend nohup to the command, so that you can close the X terminal without closing Skype as well (I believe closing an X terminal is treated as a logout, and sends SIGHUP to all "connected" processes ).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Terminal commands running behind the GUI Suhail Sherif Linux - Newbie 1 01-10-2010 02:25 PM
Problems running console commands using QProcess montylee Programming 4 09-27-2008 02:36 AM
console commands for gui actions pcandpc Linux - Newbie 2 05-16-2005 10:29 PM
fluxbox - running commands without console geomatt Linux - Software 18 09-22-2004 12:17 PM
Console commands && GUI DaFrEQ Programming 10 05-29-2003 01:00 PM


All times are GMT -5. The time now is 08:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration