Quick Tip
The `nohup` Command: Running Processes in the Background, Uninterrupted
Challenge: You need to run a long-running command or script in the terminal, but you need to be able to close your SSH session or the terminal window without the process being terminated.
The Solution: Use the nohup command.
nohup your_command &
Why it works: nohup stands for “no hang up.” It intercepts the SIGHUP (hang up) signal that is sent to a process when its controlling terminal is closed, preventing the process from terminating. The & at the end of the command sends the process to the background.
Pro-Tip: By default, nohup redirects standard output to a file named nohup.out in the current directory. You can redirect it elsewhere using standard shell redirection, e.g., nohup your_command > /path/to/your/logfile.log 2>&1 & to send both stdout and stderr to a specific file.
Linux Tips & Tricks | © ngelinux.com | 4/29/2026
