In nohup is a POSIX command to ignore the HUP ( hangup ) signal. This signal is from a terminal used to notify dependent processes on logout. Usually dependent processes of the terminal would be terminated as a result of signal reception.

Using nohup, the output of the process that was supposed to go to the terminal, written to a file called nohup.out, if it has not already been diverted elsewhere.

Nohup is a primitive tool that is configured as a command to ignore a particular signal. Thus, it is still far from offering a solution to all possible problems of an asynchronous program operation, as it could be about making a complete batch processing system the case.


The following example starts the program foo in the background so it is not canceled by subsequent Logout:

$ Nohup foo & $ exit This prevents that the process receives a STOP signal on logout. However, if a Ein-/Ausgabe through the standard I / O (stdin, stdout, or stderr) is carried out, yet this is "hanging" of the terminal will cause ( see below).

Nohup is often used together with the nice command to affect the priority of the process.

$ Nohup nice abcd & Existing jobs and processes

Some shells (eg bash) have pre-made ways to suppress sending or forwarding the SIGHUP signal to existing jobs, even if they have not started with nohup. In bash, this can be achieved by entering disown -h job. If this command is invoked without arguments, the job is removed from the job table, which then also means that he does not receive the signal.

Before disown is applied to an active job, this should be stopped with Ctrl -Z and then moved with the bg command in the background. Another relevant bash shopt option is huponexit, which can be ensured that a HUP signal is automatically sent to the job if the shell terminates normally.

The AIX and Solaris versions of nohup have a -p option, which causes for a running process that he ignored future SIGHUP signals. In contrast to disown, as described above, accepts nohup p process IDs as parameters.

Avoiding the terminal hanging

Applying nohup on a job in the background is typically used to prevent it is to terminate when an SSH session is terminated. Another problem arises if SSH does not allow these Logout ( "hangs" ) because no data will be lost by or for the background jobs. This problem may be solved by directing the I / O streams:

$ Nohup. / Program > foo.out 2 > foo.err


  • The screen or tmux command can trigger a process as well by the current shell. A re- attachment of the process to the shell at a later time is also possible.

$ Screen- A- m- d -S somename. / & The disown command is used to remove jobs from the job table or to mark them not to receive the SIGHUP signal.