Skip to content

nohup persistent process execution

nohup is a command-line utility used to execute processes that are immune to hangups (signals) and continue running after the user logs out or disconnects from the session^[600-developer__linux__centos7-command.md].

Usage and Syntax

The standard method to make a program persistent involves redirecting output streams and placing the process in the background^[600-developer__linux__centos7-command.md].

The basic syntax is:

nohup /path/my_program > my.out 2> my.err &

This command performs three distinct actions: 1. Immunity to Hangups: nohup prevents the process from stopping when the session ends. 2. Output Redirection: Standard output is redirected to my.out and standard error is redirected to my.err. 3. Background Execution: The & operator sends the job to the background, allowing the terminal to be used for other tasks^[600-developer__linux__centos7-command.md].

  • [[Standard streams]] (for understanding > and 2>)
  • [[Background jobs]] (for context on the & operator and job control)

Sources

  • 600-developer__linux__centos7-command.md