Log in Go to the main page Page Discussion History Go to the file list Go to the site toolbox Bookmark and Share

Nohup command

From RZWiki


Image:linux-logo-large.png

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

Image:Vm-power-on-medium.png Usage Syntax

nohup command_name

Image:Vm-power-on-medium.png 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

Image:accessories-text-editor-v2-medium.png 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.

Image:gnometris-medium.png 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.

Image:accessories-text-editor-v2-medium.png 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

Image:emblem-package-medium.png 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

Image:Folder-medium.png 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.

Image:object-flip-vertical-medium.png Command Alternatives

Use the shell function disown -h PID

Image:icemon-medium.png Related Commands

fg command

bg command

command - Linux shell function

kill command

Image:icemon-medium.png Related Articles

Information on other Linux commands Image:Tux-small.png

Information on F5 BigIP commands Image:F5-logo-small.png

Information on Cisco commands Image:Cisco-logo-small.png

Information on Vyatta commands Image:Vyatta-logo-small.png

Information on Extreme commands Image:Extreme-logo-small.png

Information on Nortel commands Image:Nortel-logo-small.png

Information on Zebra commands

Information on Windows commands Image:Preferences-system-windows-small.png

Information on Secure Platform commands

Information on Blue Coat SGOS commands

Information on Nokia IPSO commands

Image:accessories-dictionary-medium.png Further Information

Image:internet-group-chat-small.png We really do appreciate all feedback so please do send your comments, suggestions or corrections to sjiveson#routerzone.eu
(replacing the # with an @)


Site Toolbox:

Personal tools
This page was last modified on 11 December 2009, at 16:06. - Disclaimers - About RZWiki
Powered by MediaWiki