February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Runs jobs in the background.
Syntax
bg [job_id...]
Options
None
Oddities
If no job_id is given, the most recently suspended job is used.
Available on systems that support job control.
Used to get a stopped job to resume execution but remain in the background.
Example
$ cat buzz
#! /bin/ksh
integer x=17
while :
do
x=17
done
$
$ buzz
[1] + Stopped buzz # Ctrl+Z
$
$ jobs
[1] + Stopped buzz # Job buzz is stopped
$
$ bg %1 # Get it going in the background
[1] buzz&
$
$ jobs
[1] + Running buzz # Job buzz is running now,
# in the background
$
Read now
Unlock full access