Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I run a lot of programs in Ubuntu from the terminal, but I would like to be able to continue using the terminal after I have a program open. How can I put the programs in the background so that I don't have to open another window?

share|improve this question
    
"Blocking" seems perfectly fine in this context - you're good! (Nice website, by the way =P) –  WindowsEscapist Dec 2 '12 at 1:40
add comment

2 Answers

up vote 9 down vote accepted

There are different ways to run a terminal program and continue using the terminal:

  • You can open another terminal tab (right-click, then select "Open New Tab").
  • You can append & to the command you run. Be aware that you will not see text output to the terminal, such as error messages.
  • You can type Ctrl-Z and then run bg. This has the same effect as running command &
  • You can run nohup command & and then press enter. (Thanks to ccpizza, see comments below.)

However, pressing Alt-F2 and then running your command from the GUI is usually considered best practice - there is no terminal at all!

Note that when using & (not nohup), closing the terminal will still terminate the application unless you run disown afterwards.

EDIT: It looks like using nohup will sometimes leave little droppings in your home folder. What would normally have been logged to the terminal is apparently saved to a file in ~/.

~~

A simple way to run a program in the background is program-name & disown, which will drop you to a terminal which can be closed without killing the process.

share|improve this answer
1  
To prevent killing the child process after the terminal is closed you can start your app as nohup firefox&. –  ccpizza Dec 3 '12 at 22:25
    
Cool! I didn't know that (but upon experimentation, the terminal is still "blocked")! –  WindowsEscapist Dec 3 '12 at 23:35
    
it is not 'blocked', it only 'looks' blocked, if you type enter once you will get a prompt. –  ccpizza Dec 4 '12 at 21:07
    
Ah, I didn't notice that before. –  WindowsEscapist Dec 5 '12 at 0:06
add comment

You can run the command with a & after.

For example:

thunderbird &

See Here for more info.

share|improve this answer
add comment

Your Answer

 
discard

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.