From LQWiki
Jump to navigation Jump to search

nohup is a command used to run a process and have it continue to run regardless whether you log out and close the connection to a server.

When you are connected to a server and wish to log out, a hangup (SIGHUP) signal is sent to all the processes you have run. Using nohup to run a program causes this signal to be ignored.

For example, you might want to download some files with wget, and be able to log out and have these files still download for you. One could use

nohup wget --quiet &

to have wget download these files in the background, and continue to do so even after you log out. The quiet flag is set because while wget is in the background, the job will suspend if it creates any output to the terminal.

The use of nohup is not restricted to remote logins, however, one can use it for example in X, with an xterm open, one can nohup a process and have it run even if the xterm is closed.

Provided by

Most (all?) Linux distributions incorporate this from the GNU Coreutils: and use its man page

Related Commands

These all relate to running commands in an altered context.

  • chroot - Confine the program to "jail".
  • env - Change variables.
  • nice - Change priority.
  • stdbuf - Change buffering of standard I/O filestreams.
  • su - Change user
  • timeout - Limit the time.
  • gdb - Run under control of a debugger
  • script - Capture all program output
  • valgrind - Validate program behavior
  • strace - Create a log of system calls.

See also

This article is a stub and needs to be finished. Plunge forward and help it grow!