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

When we want to open an application or file from the terminal, we type, say,

okular file.dvi

This opens the application, but also shows the status of the application. We cannot close the terminal, because it kills the process. Unfortunately, if you're trying to, for example, create a LaTeX file, you will need one tab for the text editor, one for the dvi file, and so on. And if you're trying to open all windows from the terminal, you can forget it. I'm trying use the terminal as much as possible, and while I have Yakuake, it is still a bother having so many tabs and seeing which of those have an application I've killed and so on.

So, is there a way to open an application/file from the terminal so that the status doesn't show and immediately gives the prompt so that we can use it to open more applications?

share|improve this question
Given your requests, regarding not seeing any output, the viewer not being a child processes of the terminal, etc, it seems an ideal candidate for when simply using a keyboard shortcut to open the viewer, or using e.g. grun to also pass in the filename, would be more suitable than sticking to using a terminal. – jmetz Jul 23 '12 at 18:04
I don't mind not seeing any output... I mind having to have multiple terminals/tabs open for multiple applications. The answer I have chosen suits all my preferences perfectly. – asymptotically Jul 23 '12 at 18:15
Ahh ok, thanks for the clarification. – jmetz Jul 23 '12 at 18:18
up vote 23 down vote accepted
xdg-open file.dvi

xdg-open will open any file with its default application. As a bonus, you can close the terminal without killing the application.

Since xdg-open is quite a long name, I put an alias for it in .bashrc:

alias go='xdg-open'
share|improve this answer
Sweet! This is the best, even better than the one I had selected! And you get a 'Revival' badge :) – asymptotically Aug 1 '12 at 8:04
Simple awesome ! – Yugal Jindle Dec 26 '13 at 6:25
okular file.dvi &

just append an & to make your command running as separate process.

share|improve this answer
Wow! Perfect! Funny... I searched Google for "open from terminal without showing status," never thought that it behaved like a separate process! Unfortunately, it says I have to wait for 8 minutes, so... – asymptotically Jul 23 '12 at 17:33

okular file.dvi &> /dev/null & would be a bit better. This way, the program does not write to the terminal.

If you use just okular file.dvi & the program will still report things on the terminal, often in the middle of your work

share|improve this answer

With, say, evince file.pdf &, closing the terminal will still close the process, so that it is still a child process of the terminal and has no independence of it; nohup evince file.pdf & will allow you to close the terminal without the program closing as nohup means that any signals for the process to close (hangup) will be ignored. You can also disown a process in a similar way, see this discussion here.

share|improve this answer
Thanks, I didn't know that. I use Yakuake, and I never close it, so it's not a problem. But it's always useful to know such things. – asymptotically Jul 23 '12 at 18:03
I just edited my post- see the difference- it will work now – user76204 Jul 23 '12 at 18:07
Sorry - I had forgotten to put the & at the end :) – asymptotically Jul 23 '12 at 18:08
When I try evince file.pdf &, it doesn't kill the process when I quit the terminal... – asymptotically Jul 23 '12 at 18:11
When you start a child process, it belongs to the parent process. In this case, evince is the child process belonging to the terminal. Hence, when you close the terminal, it also closes the child processes. nohup separates this ownership, so it is what to use if you want to close the terminal. However, by default, nohup creates a file nohup.out in your home folder. If you don't want that file, use redirection as follows: nohup evince file.pdf &>/dev/null & – Paddy Landau Jul 31 '12 at 9:11

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.