Super User is a question and answer site for computer enthusiasts and power users. 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

What is the difference between:

nohup bin/admin/ > /users/john/release_output 2>&1 &


bin/admin/ > /users/john/release_output &

I want to run and run it in backround (it should continue working even if I close shell window), I also want to save output to release_output in my home directory (/users/john/)

share|improve this question
  • The trailing & runs the process in the background. The important aspect of this is that you get a command prompt back without waiting for the script to finish and can therefore issue a logout command without waiting.
  • The 2>&1 ensures that the process doesn't get a "broken pipeline" signal when STDERR's destination (the terminal/tty) is disconnected (but I think nohup may take care of that). You could instead redirect STDERR to a separate file if preferred.
  • nohup ensures the process isn't sent a HUP (hangup) signal when the associated terminal session is closed.

If you read the man page for nohup you should see it is designed specifically for what you want to do.

share|improve this answer

If you want to run it in background and keep running even user logout then nohup is there for you.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .