nohup on Linux is searched constantly — you start a backup or data import over SSH, close the laptop, and wonder if the process died. nohup (no hang up) tells the shell to ignore the hangup signal so the child keeps running when your session ends.
Alternatives: tmux ,
cron ,
systemd services .
What nohup Does
When SSH disconnects, the kernel sends SIGHUP to your shell — by default that kills background jobs unless they are immune.
hangup
Basic nohup Syntax
Append & to run in the background; capture the PID for later checks.
bash long job Copy
nohup ./long-backup.sh >> /var/log/backup.log 2>&1 &
echo $! > /var/run/backup.pid
PID
Redirect stdout and stderr
Default nohup.out in the current directory is messy — always point logs somewhere explicit.
bash redirect Copy
nohup myjob.sh > /var/log/myjob.log 2>&1 &
bash detach Copy
./slow-task.sh &
jobs -l
disown -h %1
jobs -l
SSH and Interactive Sessions
nohup is fine for one-off tasks; for repeatable admin work prefer a persistent multiplexer.
Tip Production long runners should be a systemd unit with Restart= and journal logging — not a forgotten nohup.
screen
nohup vs cron vs systemd
Match the tool to how often the job runs and how you need to observe failures.
schedule
Verify the Process
Confirm PID still exists and logs are growing before you log out.
bash check Copy
ps -p $(cat /var/run/backup.pid) -o pid,cmd
tail -f /var/log/backup.log
tail -f
Quick Reference
nohup COMMAND >> log 2>&1 & survives SSH disconnect
Save PID with echo $! for monitoring
Services: use systemd , not eternal nohup
Related tutorials
Diagrams are original illustrations by Gnome IT Solutions. Tutorial text © Gnome IT Solutions.