Linux Processes Cheat Sheet/Run command immune to hangups

Keep a process running after the shell exits.

Section: Backgrounding and Daemonization

Run command immune to hangups

bash
bash
nohup ./worker.sh > worker.log 2>&1 &
Explanation

Keep a process running after the shell exits.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Backgrounding and Daemonization
Run inside screen
Use screen for a resumable terminal session.
OpenIn sheetbashsame section
Run inside tmux
Use tmux for persistent terminal multiplexing.
OpenIn sheetbashsame section
Start in a new session
Start a process in a new session detached from the terminal.
OpenIn sheetbashsame section
Limit runtime with timeout
Terminate a command if it runs too long.
OpenIn sheetbashsame section
Measure elapsed time
Measure runtime of a command.
OpenIn sheetbashsame section
Repeat command with watch
Re-run a command periodically for live monitoring.
OpenIn sheetbashsame section