Processes and tasks

Command jobs

Show jobs in the current shell session

Linux · Bash examples · commands run on the selected server

When to use jobs

Use jobs to inspect tasks tracked by the current interactive shell. Its job numbers are convenient for bg and fg, but they are separate from system-wide process IDs.

Syntax

jobs [PARAMETERS] [%JOB]

Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.

Common options and arguments

-l
Add process IDs.
-r
Show running jobs.
-s
Show stopped jobs.

Usage examples

Run background job

sleep 120 &

A temporary task is started so it appears in the shell's job table.

Show tasks with PID

jobs -l

The shell's jobs are displayed together with their process IDs.

Show running jobs

jobs -r

Only jobs currently in the running state are shown.

Notes and limitations

  • The built-in command shows the jobs of the current shell, not all server processes.
  • The list of the other SSH-session will be separate; for the big picture use ps.

Common questions and troubleshooting

Why does jobs show nothing after reconnecting?

The new shell has its own job table. It cannot enumerate jobs from a previous shell as if they were created locally.

Can jobs list all server processes?

No. Use ps or another system process tool to inspect processes outside this shell's job-control table.

Further help

Options vary by version and distribution. Check the installed documentation with this command: help jobs.