bg — Move a job to the background

Format

bg [job…]

tcsh shell: bg [%job ...]

Description

bg runs one or more jobs in the background. The job IDs given on the command line identify these jobs, which should all be ones that are currently stopped. If you do not specify any job IDs, bg uses the most recently stopped job. It works only if job control is enabled; see the –m option of set for more information. Job control is enabled by default in the z/OS shell.

In the tcsh shell:
  • bg puts the specified jobs (or, without arguments, the current job) into the background, continuing each if it is stopped. job can be a number, a string, ", %, + or - .
  • %job & is a synonym of the bg command.

Localization

bg uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_CTYPE
  • LC_MESSAGES
  • NLSPATH

See Localization for more information.

Usage notes

bg is a built-in shell command.

Exit values

0
Successful completion
>0
Failure because a job argument is incorrect or there is no current job

If an error occurs, bg exits and does not place the job in the background.

Portability

POSIX.2 User Portability Extension, UNIX systems.

Related information

at, batch, fg, jobs, set, tcsh