How to keep a process running on Linux after you log off

By default, processes run on the Linux command line are terminated as soon as you log out of your session. However, if you want to start a long-running process and ensure that it keeps running after you log off, there are a couple ways that you can make this happen. The first is to use the nohup command.

Using nohup

The nohup (no hangup) command will override the normal hangups (SIGHUP signals) that terminate processes when you log out. For example, if you wanted to run a process with a long-running loop and leave it to complete on its own, you could use a command like this one:

% nohup long-loop &
[1] 6828
$ nohup: ignoring input and appending output to ‘nohup.out’

Note that SIGHUP is a signal that is sent to a process when the controlling terminal of the process is closed.

To read this article in full, please click here

Source:: Network World – Data Center