Home·Terminal commands

jobs

Processes and system

Usage

jobs [-l]

A shell builtin that numbers the background jobs of this shell only, so jobs from another terminal never appear and you refer to them as `%1`, not by PID.

Common flags

FlagMeaning
-lInclude the PID of each job.
-pPrint only PIDs, handy for piping into kill.
-rRunning jobs only.
-sStopped jobs only.

Examples

jobs -l

List the background jobs of this shell with their PIDs.

kill %1

Stop job number 1 as shown by jobs.

What is running and what is eating the machine. Identifying it comes before killing it.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

Q. What does jobs do?

A shell builtin that numbers the background jobs of this shell only, so jobs from another terminal never appear and you refer to them as `%1`, not by PID.

Q. How do I type it?

jobs [-l] — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

4 are listed here; the full set is in man jobs. This command sits under Processes and system.

Related commands

man page: man jobs