Table of Contents

Linux - nohup (No Hangup)

About

nohup is a POSIX command to ignore the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out.

nohup is most often used to run script or command in the background as daemons. Output that would normally go to the terminal goes to a file called nohup.out if it has not already been redirected. This command is very helpful when there is a need to run numerous batch jobs which are inter-dependent.

nohup ./myscript > mystdoutput.log&

Don't forget the ampersand.

Process

Nohup effectively separate the process from the terminal:

nohup doesn't put the job in the background but since a foreground nohup job is more or less useless, you'd generally put it into the background using &. Unlike with disown, the shell will still tell you when the nohup job has completed (unless the shell is terminated before, of course).

Documentation / Reference