Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use dwm as a window manager on Ubuntu, I like tiled windows and I like them as few as possible. I sometimes need to run an application (let's say it's the pdf viewer mupdf in x11) from the terminal, the application will be launched in a new window but the terminal from which I launched becomes this prompt-less console for that application to log whatever.

I use dmenu to launch applications, but sometimes an application needs arguments (file names) to start. I use uxrvt within x11 managed by dwm.

share|improve this question
up vote 23 down vote accepted

You could use the nohup to prevent the GUI to be attached to a terminal:

nohup mupdf some.pdf &

This will allow you to close the terminal you are launching from, without the program being closed.

You should also notice, that the nohup command will create a file with the stdout and stderr of the command you run. If you want to prevent that, add &>/dev/null before the &.

nohup mupdf some.pdf &>/dev/null &
share|improve this answer
"nohup" stands for "no hang up". This dates back to early Unix, when (physical) terminals were regularly attached via telephone lines, and you'd therefore close a terminal by hanging up the phone. – MSalters Aug 12 '13 at 8:05
Additional information: The nohup command will create a file nohup.out containing output from the command. This is useful if you want to view error messages. If you don't want the file to be created, add redirection as follows: nohup mupdf some.pdf &>/dev/null & – Paddy Landau Aug 13 '13 at 11:02

You can also use disown command. It is particularly useful when you've already started the process you no longer want attached to the terminal.

The basic procedure if I remember correctly, is something like this:

$ > firefox      #Oops
Ctrl + z         #Suspend the process
$ > bg           #Push the process to the background
$ > disown       #Detach most recent process started or stopped
$ > exit         #Terminal gone!

Note that disown is bash specific.

This blog post explains both methods pretty well.

Man page for disown

share|improve this answer
A shortcut: firefox & disown – Flimm Jun 3 '15 at 9:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.