🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

bg Command

Intermediate Process Management man(1)

Resume a suspended job in the background

👁 10 views 📅 Updated: Mar 15, 2026
SYNTAX
bg [JOB_SPEC]

What Does bg Do?

The bg command resumes a suspended job in the background. When you press Ctrl+Z, the foreground process is suspended (stopped). bg then restarts it as a background job, freeing your terminal for other commands.

bg is a shell built-in used for job control. It works with job numbers from the jobs command. Without arguments, it resumes the most recently suspended job.

This command is essential for the workflow: start a command, realize it will take a long time, press Ctrl+Z to suspend, then bg to continue it in the background.

Options & Flags

OptionDescriptionExample
%N Resume job number N in background bg %1
%% Resume current (most recent) job bg
%- Resume previous job bg %-

Practical Examples

#1 Resume last suspended job

Resumes the most recently suspended (Ctrl+Z) job in the background.
$ bg
Output: [1]+ make -j4 &

#2 Resume specific job

Resumes job number 2 in the background.
$ bg %2

#3 Typical workflow

Suspend a long-running build and continue it in the background.
$ make -j4 # Press Ctrl+Z bg # Now make runs in background

#4 Multiple background jobs

Resumes multiple suspended jobs in the background.
$ bg %1 bg %2

Tips & Best Practices

Ctrl+Z then bg workflow: Started a long command? Press Ctrl+Z to suspend, then bg to run in background. Your terminal is free again.
bg vs &: command & starts a new job in background. bg resumes a suspended job in background. Both result in background execution.
Output goes to terminal: Background jobs still print to your terminal. Redirect output before backgrounding: command > log 2>&1 then Ctrl+Z, bg.

Frequently Asked Questions

How do I move a running process to the background?
Press Ctrl+Z to suspend it, then type bg to resume it in the background. The terminal is now free for other commands.
What is the difference between bg and &?
& starts a NEW command in the background. bg resumes a SUSPENDED command in the background. bg is used after Ctrl+Z.
How do I see my background jobs?
Use the jobs command to list all background and suspended jobs with their job numbers.

Master Linux with Professional eBooks

Curated IT eBooks covering Linux, DevOps, Cloud, and more

Browse Books →