HxHippy

bg

Send a job to the background

Overview

Resumes a suspended job and runs it in the background.

Syntax

bg [JOB_SPEC...]

Common Options

[JOB_SPEC]

Specifies the job to send to the background. If omitted, the current job (%+) is used.

%n

Job number n (e.g., bg %1).

%string

Job whose command line begins with string (e.g., bg %vim).

%?string

Job whose command line contains string.

%+ or %%

Explicitly refers to the current job.

%-

Refers to the previous job.

Examples

$ bg

Sends the most recently suspended or backgrounded job to the background.

$ bg %1

Sends job number 1 to the background.

$ bg %vim

Sends the most recent job whose command starts with "vim" to the background.

$ sleep 60 &

Start sleep in background. Then `bg` to send it to background.

$ vim myfile.txt (then Ctrl+Z)

Suspend vim. Then `bg` to resume it in the background.

backgroundjobresumeprocessshelljobspecbgfgjobs