Job Control
jobs | List your jobs |
& | Run a job in the background |
^Z | Suspend the current (foreground) job |
suspend | Suspend a shell |
fg | Unsuspend a job: bring it into the foreground |
bg | Make a suspended job run in the background |
All Linux shells have job control: the ability to run programs in the background (multitasking behind the scenes) and foreground (running as the active process at your shell prompt). A job is simply the shell’s unit of work. When you run a command interactively, your current shell tracks it as a job. When the command completes, the associated job disappears. Jobs are at a higher level than Linux processes; the Linux operating system knows nothing about them. They are merely constructs of the shell. Some important vocabulary about job control is:
- foreground job
Running in a shell, occupying the shell prompt so you cannot run another command
- background job
Running in a shell, but not occupying the shell prompt, so you can run another command in the same shell
- suspend
To stop a foreground job temporarily
- resume
To cause a suspended job to start running again