Or how to execute a Unix command that is immune to hangups. Sometimes when you are working on your Unix machine, you’ll want to run commands that can survive to logouts or unexpected session terminations. Most Unix flavors provide the nohup command to handle these situations.
When your unix session unexpectedly terminates or you logout, all the processes will be killed. However, if you start a command with nohup (no hangup), it will ignore a HANGUP signal.
Simply type:
nohup COMMAND &
Now logout and login again and you will see that COMMAND is still running.
ps -ef | grep -i COMMAND
Note that if you do not redirect the standard error or standard output, the system will create a file named nohup.out in the current directory or in the $HOME directory. To avoid this behaviour you could start COMMAND as follows:
nohup COMMAND > /var/log/cron.log 2>&1