HxHippy

jobs

List active jobs

Overview

Displays the status of jobs started in the current shell session (background processes).

Syntax

jobs [OPTION]... [JOB_SPEC...]

Common Options

-l

List Process IDs (PIDs) in addition to the normal job information.

-p

List only the PIDs of the jobs. This is useful for scripting.

-n

Display only jobs that have changed status since the user was last notified.

-r

Restrict output to running jobs.

-s

Restrict output to stopped (suspended) jobs.

[jobspec...]

If jobspec (e.g., %1, %+, %process_name) is given, output information only for that specific job.

Examples

$ jobs

Lists all active jobs (running or stopped) in the current shell.

$ jobs -l

Lists active jobs along with their PIDs and state.

$ jobs -p

Lists only the PIDs of all active jobs.

$ jobs -r

Lists only running jobs.

$ jobs -s

Lists only stopped (suspended) jobs.

$ sleep 100 & jobs %1

Runs `sleep 100` in the background, then lists information specifically for that job (job number 1).

jobsbackgroundprocessliststatusshell