Launching graphical programs from a terminal window

Peter Garrett peter.garrett at optusnet.com.au
Fri Feb 3 07:42:12 UTC 2006


On Fri, 3 Feb 2006 09:17:38 +0200
Andre Truter <andre.truter at gmail.com> wrote:

> On 2/3/06, thephotoman <rantman_2000 at yahoo.com> wrote:
> > I remember that there was a way to launch graphical programs in the
> > terminal that allowed the terminal window to be closed without also
> > closing the program.  However, I cannot remember what it is.  Could
> > someone refresh my memory?
> >
> 
> just add and ampersand after the command.  For example:
> 
> xterm &
> 
> The ampersand tells the terminal to detatch the process from the
> terminal and push it to the background.
> 

Actually, you'll find that simply using "command-here &" dosn't detach the
program - just puts it in the background. Thus normally closing the
terminal will also close its child processes, including the backgrounded
ones.

What you can do, however, is issue the command

jobs

to see which processes are running in the background, then issue

disown %2  (or %1 or whatever the number of the process is)

when you close / exit the terminal, the "disowned" program will continue
running.

Peter

 -- 
'If I ever saw an animated penguin with a speech bubble saying, 
"It looks like you're trying to edit fstab", 
I'd switch to BSD faster than a speeding Gentoo user.'
-- Paul Hudson




More information about the ubuntu-users mailing list