from http://www.gnu.org/software/coreutils/manual/html_node/nohup-invocation.html
nohup runs the given command with hangup signals ignored, so that the command can continue running in the background after you log out.
Synopsis:
nohup command [arg]...
If standard input is a terminal, redirect it so that terminal sessions do not mistakenly consider the terminal to be used by the command.
Why do we need to do this:
Make the substitute file descriptor unreadable, so that commands that mistakenly attempt to read from standard input can report an error.
Isn't redirection stdin from a file done by
nohup command [arg]... 0<myfile
? why0>/dev/null
?This redirection is a GNU extension; programs intended to be portable to non-GNU hosts can use
nohup command [arg]... 0>/dev/null
instead.