job control

The shell feature for managing the commands it started: listing them with jobs, and moving them between foreground and background with fg and bg.

In more detail

A job is a command or pipeline your shell started, named with a percent sign and its number, such as %1. Control Z suspends the foreground job, bg lets it continue in the background and fg brings it back to the terminal. Job control is an interactive feature, but kill %1 and wait also work inside scripts.

Examples

sleep 30 &
jobs
fg %1
The shell numbers each job in its job table, shown by jobs, and fg %1 or bg %1 move job 1. A job number only means something to that shell; other tools need the PID. Job control does not make a command durable: it changes how you interact with it, not whether it survives logout.
job=1 pid=42 state=running terminal=shared shows a job number and PID for the same process.

Related terms

Taught in

References

Certification courses