Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How to clean launch a GUI app via the Terminal (so it doesn't wait for termination)?

For example, if I want to run Netbeans from the CLI, I can type:

$ /usr/local/netbeans-7.0/bin/netbeans

But by doing this, the command line is rendered useless until Netbeans has been shut down. Hitting CTRL+C to end the process will kill Netbeans and return the command line to the user but how do you launch applications while retaining control of the command line? Is it possible to run a task in the background while still using the command line?

share|improve this question

marked as duplicate by con-f-use, Jorge Castro, Jjed, Stephen Myall, htorque Aug 25 '12 at 20:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 8 down vote accepted

You can put nohup in front of it and & behind it.

Nohup will take care of all the messages created by the command to not show up. The & will actually fork the command.

share|improve this answer
    
I was gonna say the exact same thing but saw your post first lol great answer! And nohup ftw :D –  zkriesse Jul 9 '11 at 19:46
    
Thanks, this is exactly what I was looking for. –  Tom Jowitt Jul 9 '11 at 23:53

If you launch something from the command line and only later decide you want to keep working in your terminal without stopping the program, you can:

  • suspend the process with "crtl + z"
  • separate the process from your terminal (and de-suspend it) with "bg"

For example, suppose you launch firefox:

$ firefox

(now the terminal is unresponsive, so type the following)

$ <Ctrl-z>

$ bg

Now if you close the terminal, firefox does not close (because it has been "backgrounded").

Note: without the "bg", the program is suspended and unresponsive.

share|improve this answer

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