Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-07-2005, 03:33 AM   #1
LQ Newbie
Registered: Jan 2005
Location: Sweden
Distribution: SUSE 9.2 Professional
Posts: 2

Rep: Reputation: 0
Running programs from shell

Is there any way of starting a GUI program from shell and not run it trough that shell?
(So i can close that terminal window and keep the GUI program).


Last edited by Plmajholm; 01-07-2005 at 03:38 AM.
Old 01-07-2005, 03:48 AM   #2
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
You can try something like this:

firefox &
The & tells the shell to "background" the process and detaches it from the terminal.
Old 01-07-2005, 04:22 AM   #3
LQ Newbie
Registered: Jan 2005
Location: Sweden
Distribution: SUSE 9.2 Professional
Posts: 2

Original Poster
Rep: Reputation: 0
Old 01-07-2005, 05:10 AM   #4
Senior Member
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
if you forget to append the &, you can background the process this way:
$ firefox
$ bg
firefox - launches firefox, successfully ties up your shell
<Ctrl>+Z - Hold Ctrl, press Z - suspend the process
bg - stick a suspended process in the background

if you have multiple suspended processes, get the process number with
and background it with
replacing PROC_NUM with the process number.

Old 01-08-2005, 05:06 AM   #5
Registered: Nov 2004
Location: Turku, Finland
Distribution: Debian, Ubuntu, Gentoo
Posts: 388

Rep: Reputation: 30
You can also use


to see which jobs are running from the terminal, for example my jobs:

[1]+ Stopped less
[2]- Stopped nano

As said, Ctrl-Z stops running program (puts it on above joblist)

bg %1 would - in case above - background "less", and bg %2 would do so to "nano"

fg %<number> in contrary activates the chosen program.

This is in my opinion easier than to use "ps" to see which process to background


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
questions about shell programs sachitha Programming 1 08-21-2005 01:46 PM
Start programs from a shell script paraiso Linux - Newbie 4 04-29-2005 09:41 AM
help installing programs from the shell sempuritoza Linux - Newbie 6 01-20-2005 11:58 AM
controlling programs from a shell window fred22 Linux - Software 3 07-06-2004 10:12 PM
Will Programs work in shell? Borg Swarm Linux - Newbie 4 01-31-2004 09:07 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:26 AM.

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