background job

A command started with & at the end of the line, which runs while the shell immediately gives you the prompt back.

In more detail

The shell prints its job number and process ID, and $! holds that process ID. Output from a background job still appears on your terminal unless redirected. In a script, wait pauses until background jobs finish.

Examples

sleep 30 &
The ampersand is a request to the shell, not a property of the program. A background job is still tied to the terminal session and usually ends when you log out, because of the hangup signal. Backgrounding changes interaction, not reliability.

Related terms

Taught in

References