Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Say if I run some command in background:

./ > /dev/null &

and I close putty immediately (which is equivalent to disconnect current session right?).

Will the background process finish? Please advise, thanks.

share|improve this question
up vote 4 down vote accepted

When you exit an interactive bash login shell, it sends a SIGHUP to all children unless the shell option huponexit is set to off.

When most userland processes receive a SIGHUP, they will exit.

You can also prefix the command with nohup to make it ignore the SIGHUP. Moreover, you can disown it using an internal bash function.

share|improve this answer

If you want backgrounded tasks to persist, look into using screen

To create or reconnect to a screen session called 'myprocess' which will persist across sessions:

  • screen -DR myprocess

To list all screens:

  • screen -ls
share|improve this answer

Yes it should. Apparently my answer was too short.

share|improve this answer
The running script is still part of the shell process, even when sent to the background. Without specifying "nohup", the process will die w/ the shell on exit – Alex Sep 16 '10 at 22:57

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.