System and processes
The bg command
Resumes a stopped job in the background, so it keeps going without occupying the terminal.
Syntax
bg [%N]Most useful options
%NThe job number (bg %1); with no number, the last oneCopy-ready examples
$ sleep 100 & && kill -STOP %1 && jobsSuspend it and see it in jobs$ sleep 100 & && kill -STOP %1 && bg %1Continue in the backgroundYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- A stopped job does not advance until you resume it with bg or bring it back with fg.
- bg does not start anything new: it only resumes something that already existed.
FAQ
How do I stop it?
In the foreground with Ctrl+Z; if it is already in the background, with kill -STOP %N.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course