Unix Job Control Cheat Sheet
Commands
jobs
: Lists all current jobs running in the background.
fg
: Brings a background job to the foreground. Usage: fg %jobnumber
bg
: Resumes a suspended job by running it in the background. Usage: bg %jobnumber
kill
: Sends a signal to a job. Commonly used to terminate jobs. Usage: kill -signal %jobnumber
Usage
- Suspend a job:
Ctrl + Z
- Resume a job in foreground:
fg
- Resume a job in background:
bg
Notes
- Each job is referenced by a job number, shown when using the
jobs
command.
- Useful signals for
kill
: SIGKILL
(terminate immediately), SIGSTOP
(pause the process).