GO KALI FREE
Process Commands

jobs Linux Command

Lists active jobs (background and suspended processes) in the current shell.

What does jobs do?

Lists active jobs (background and suspended processes) in the current shell.

Syntax

jobs [options]

Practical example

jobs -l

Questions about jobs

How do I see background jobs?

Use `jobs` to list all background and suspended jobs in the current shell. Use `jobs -l` to also show PIDs.

What do the symbols mean in jobs output?

`+` indicates the current job, `-` the previous job. `[1]` is the job ID. Status shows as Running, Stopped, or Done.

How do I see PIDs of my jobs?

Use `jobs -l` to display the PID alongside each job ID. This is useful for killing or manipulating specific jobs.

How do I see only running jobs?

Use `jobs -r` to show only running background jobs. Use `jobs -s` to show only stopped/suspended jobs.

How do I reference a specific job?

Use `%jobid` where jobid is the number from the jobs list. For example, `kill %2` kills job 2, `fg %2` brings it to foreground.

How do I restart a stopped job in the background?

Use `bg %jobid` to resume a stopped job in the background. Use `fg %jobid` to bring it to the foreground first if needed.

Do jobs persist across terminal sessions?

No, jobs are tied to the current shell session. When you close the terminal, all jobs are terminated. Use `nohup` or `disown` for persistence.

How do I disown a job?

Use `disown %jobid` to remove a job from the shell's job table. This prevents SIGHUP when the terminal closes.

Related Process Commands

fg

Brings a background job to the foreground.

nice

Runs a command with a specified scheduling priority (niceness value).

bg

Resumes a suspended job in the background.

renice

Changes the priority (niceness) of an already running process.

pkill

Sends a signal to processes based on name and other attributes.

nohup

Runs a command that keeps running even after the terminal session is closed.