LinuxCommandLibrary

jobs

TLDR

View jobs spawned by current shell

$ jobs
copy
List jobs with process IDs
$ jobs -l
copy
Display jobs with changed status
$ jobs -n
copy
Display only process IDs
$ jobs -p
copy
Display running processes
$ jobs -r
copy
Display stopped processes
$ jobs -s
copy

SYNOPSIS

jobs [options] [jobspec]

DESCRIPTION

jobs is a shell builtin that displays the status of jobs started in the current shell session. Jobs are processes started with & (background) or suspended with Ctrl+Z.
Each job has a job number (shown in brackets) that can be used with fg, bg, and kill commands using the %n syntax. The + indicates the current job, and - indicates the previous job.

PARAMETERS

-l

List process IDs in addition to normal information
-n
Display only jobs with status changed since last notification
-p
Display only process IDs
-r
Display only running jobs
-s
Display only stopped jobs

CAVEATS

Shell builtin - behavior may vary between shells. Options -n, -r, -s are Bash-specific. Jobs are specific to the current shell session and not visible to other shells.

HISTORY

Job control was introduced in the C shell (csh) in the late 1970s and adopted by other shells including Bash. It allows users to manage multiple processes within a single terminal session.

SEE ALSO

fg(1), bg(1), disown(1), kill(1)

Copied to clipboard