$linuxjunkies
>

bg(1)

Resume a suspended job in the background.

UbuntuDebianFedoraArch

Synopsis

bg [%jobspec ...]

Description

The bg command resumes execution of suspended jobs in the background. When a job is suspended (typically with Ctrl+Z), it stops running but remains associated with the terminal session. bg allows that job to continue running without blocking the shell prompt.

If no job specification is provided, bg resumes the most recently suspended job (the "current" job). Multiple jobs can be resumed with a single command by specifying their job numbers.

Common options

FlagWhat it does
%NResume job number N (e.g., bg %1 for job 1)
%stringResume job whose command name begins with string
%%Resume the current job (same as bg with no arguments)
%+Resume the current job explicitly
%-Resume the previous job

Examples

Resume the most recently suspended job in the background

bg

Resume job number 1 (shown in jobs output) in the background

bg %1

Resume the job whose command starts with 'python' in the background

bg %python

After Ctrl+Z suspends a job, type 'bg' to resume it, then use 'fg' to bring it forward again

fg; sleep 100 &

Resume both job 2 and job 3 in the background simultaneously

bg %2 %3

List all jobs first, then resume the one you want in the background

jobs; bg %1

Related commands