Linux jobs Command: List Jobs in the Current Shell

jobs shows the background jobs and stopped jobs managed by the current Bash shell. It differs in scope from ps, which queries all processes on the system.

What is the jobs command?

The shell's job number is indicated like %1, and the operating system process ID is a numeric PID. One job can consist of multiple processes, such as in a pipeline. Jobs started from another terminal or shell do not appear in the current shell's jobs list.

Basic syntax

jobs [options] [job_specifier]

Installed implementations and options may vary depending on the distribution. Use help jobs to check the description for the current system.

Examples

Starting a background job

An ending & starts the command as a background job.

sleep 120 &

Checking jobs in the current shell

Check the job number, status, and original command.

jobs

Also display PID

Compare the job number with the actual PID.

jobs -l

Reading the current shell's job numbers

jobs shows background or suspended jobs started in the current shell, not system-wide processes.

sleep 60 &
jobs -l

Example output (PID and job numbers will differ):

[1]+ 12345 Running  sleep 60 &

[1] is the job number in this shell, and 12345 is the process PID. Running jobs in another terminal or a new shell will not show this job. If you need to keep the job after closing the shell, consider nohup, tmux, or a service manager.

Main Options and Format

Options/Format Description
-l Display PID along with job status.
-p Display only the representative PID of the job's process group.
-r Display only running jobs.
-s Display only stopped jobs.

Precautions when using

jobs is a shell built-in command and only queries the job table of the current shell. Job control may be disabled in scripts or non-interactive shells. The sleep job in the example will disappear from the list after some time, and if it remains, it can be terminated with the shell's job number like kill %1.

Frequently Asked Questions

Why are jobs empty but processes visible in ps?

The reason is that jobs only shows the tasks currently started and managed by the shell, whereas ps queries the list of system processes.

Official Documentation

You can check the exact behavior of the options and differences depending on the implementation in the official documentation on jobs.

More in This Category
Linux Tutorial / File System Basics: Paths and Key Directories

Linux Tutorial / File System Basics: Paths and Key Directories

Understand the Linux directory tree, read absolute and relative paths, and learn what common directories such as /home, /etc, and /var are used for.

Linux bzip2 Command: Compress a File in bzip2 Format

Linux bzip2 Command: Compress a File in bzip2 Format

Learn how to compress a File in bzip2 Format with the Linux bzip2 command, including practical examples, key options, and important precautions.

Linux Tutorial / Choosing a Linux Distribution

Linux Tutorial / Choosing a Linux Distribution

Explore major Linux distributions and learn when to choose Ubuntu LTS or Rocky Linux for study and server practice. Compare package management, release policies, and practical selection criteria.

Linux ssh-copy-id Command: Install a Public Key on a Remote Account

Linux ssh-copy-id Command: Install a Public Key on a Remote Account

Learn how to install a Public Key on a Remote Account with the Linux ssh-copy-id command, including practical examples, key options, and important precautions.

Linux curl Command: Make URL Requests and Inspect HTTP Responses

Linux curl Command: Make URL Requests and Inspect HTTP Responses

Learn how to make URL Requests and Inspect HTTP Responses with the Linux curl command, including practical examples, key options, and important precautions.

Linux traceroute Command: Trace Routers on the Way to a Host

Linux traceroute Command: Trace Routers on the Way to a Host

Learn how to trace Routers on the Way to a Host with the Linux traceroute command, including practical examples, key options, and important precautions.

Linux uname Command: Check Kernel and System Architecture

Linux uname Command: Check Kernel and System Architecture

Learn how to check Kernel and System Architecture with the Linux uname command, including practical examples, key options, and important precautions.

Linux ssh Command: Connect to a Remote Host Securely

Linux ssh Command: Connect to a Remote Host Securely

Learn how to connect to a Remote Host Securely with the Linux ssh command, including practical examples, key options, and important precautions.

Linux touch Command: Create Files and Change Timestamps

Linux touch Command: Create Files and Change Timestamps

Learn how to use the Linux touch command to create empty files and change access or modification timestamps, including reference times, date formats, and symlink handling.

Linux more Command: View Text One Screen at a Time

Linux more Command: View Text One Screen at a Time

Learn how to use Linux more to read text one screen at a time, move and search interactively, start at a line or pattern, and choose between more and less.