Nohup command
From RZWiki
A CLI command available on most Linux platforms; used to run a command or program as a process that is immune to (will ignore) hangups. Hangups are commonly known as HUP signals or SIGHUPs. This is extremely useful in circumstances where you wish a command launched from a console, terminal or shell to continue to run even if that console, terminal or shell is closed or terminated or when you logout.
Contents |
Usage Syntax
nohup command_name
Usage Examples
nohup tcpdump -i eth0 -vv -nn -w /var/tmp/test.cap host 1.1.1.1 - run the specified tcpdump command as a process
nohup tcpdump -i eth0 -vv -nn -w /var/tmp/test.cap host 1.1.1.1 [[ command|]] - run the specified tcpdump command as a process, in the background; allowing other commands to be entered at the console, terminal or shell
Usage Notes
Any command (including error) output is appended to the file nohup.out in the present working directory. If that file cannot be created or written, the file $HOME/nohup.out is used. If that file cannot be created or written, the command is not run.
The specified command cannot be a shell function
Some commands and programs, such as the wget command have a built in option that performs the same function as this command.
Use the kill command to terminate the command process when needed.
Command Combinations
noinclude/noinclude
Use with the [[ command|]] shell function to start the command in the background, if you want to run other programs before closing or terminating the console, terminal or shell.
Linux Usage Notes
With most Linux or Unix commands;
- Non root users may need to prefix commands with the sudo command, for example: sudo chmod 644 *
- Brief help can be displayed using the -h or --help parameter, for example: chmod --help
- A full command manual can be displayed using the man command followed by the command name, for example: man chmod
- Sometimes 'info' pages are used instead of or to provide more information than man pages; for example: info chmod
- Version information can normally be display using the -v, -V or --version parameter, for example: chmod --version. However, this paramater is also frequently used to display verbose output.
noinclude/noinclude
Installation
This command is part of the GNU coreutils package, which can be installed or upgraded as follows, depending on your platform;
- Ubuntu: apt-get install coreutils
- Fedora Core: yum install coreutils
- FreeBSD: pkg_add -v -r coreutils
Related Files
The nohup executable is normally found here: /usr/bin/nohup
Any command (including error) output is appended to the file nohup.out in the present working directory. If that file cannot be created or written, the file $HOME/nohup.out is used. If that file cannot be created or written, the command is not run.
Command Alternatives
Use the shell function disown -h PID
Related Commands
command - Linux shell function
Related Articles
Information on other Linux commands
Information on F5 BigIP commands
Information on Cisco commands
Information on Vyatta commands
Information on Extreme commands
Information on Nortel commands
Information on Zebra commands
Information on Windows commands
Information on Secure Platform commands
Information on Blue Coat SGOS commands
Information on Nokia IPSO commands
Further Information
(replacing the # with an @) |






