Home·Terminal commands

bg

Processes and system

Usage

bg [%<job>]

Resumes a job you stopped with Ctrl+Z, in the background; it still belongs to this shell, so closing the terminal takes it with you unless you used nohup or disown.

Common flags

FlagMeaning
%1Resume job number 1 in the background.
%% or %+The current job, which is what bg uses when given no argument.
%-The previous job.
%makeThe job whose command line starts with make.

Examples

bg

Resume the job you just stopped with Ctrl+Z, in the background.

bg %2

Resume job 2 in the background while you keep using the shell.

What is running and what is eating the machine. Identifying it comes before killing it.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

Q. What does bg do?

Resumes a job you stopped with Ctrl+Z, in the background; it still belongs to this shell, so closing the terminal takes it with you unless you used nohup or disown.

Q. How do I type it?

bg [%<job>] — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

4 are listed here; the full set is in man bg. This command sits under Processes and system.

Related commands

man page: man bg