Suspend and resume shell processes
Ctrl+Z sends SIGTSTP and stops the foreground job — it's frozen, not running, consuming no CPU until resumed. Ctrl+C (SIGINT) terminates it instead.
Reference
| Action | Command |
|---|---|
| Suspend foreground job | Ctrl+Z |
| Resume in foreground | fg (or fg %2 for a specific job) |
| Resume in background | bg (or bg %2) |
| List jobs | jobs (-l for PIDs) |
| Kill by job spec | kill %1 |
| Start backgrounded | cmd & |
| Detach from shell's job table | disown %1 |
Survive SIGHUP on logout | nohup cmd & |
Example
1$ sleep 60
2^Z
3[1]+ Stopped sleep 60
4$ bg
5[1]+ sleep 60 &
6$ jobs
7[1]+ Running sleep 60 &disown %1 removes the job from the shell's job table so it survives shell exit. nohup does the same up-front and redirects HUP, useful for jobs you start with the intent of leaving running after you log out.