Stage 4 · Lesson 5 of 8
Foreground, background and jobs
The shell can run a program in the , where it holds your terminal until it ends, or in the background, where you can keep typing. These are called jobs. Add & to the end of a command to start it in the background.
Press Ctrl+Z to pause the program in front of you. Then type bg to let it carry on in the background, or fg to bring it back to the front. jobs lists them.
Background jobs still stop when you close the terminal, unless you use nohup or a tool such as , covered in the server stage. This is handy for running a while you keep working.
Common trapstarting several dev servers in the background, forgetting them, and then fighting " already in use".
A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- BookFreeThe Linux Command Line
William Shotts · Beginner
Its chapters on permissions and processes are the clearest free explanation of this stage
- GuideFreeThe Linux Command Line for Beginners (Ubuntu)
Canonical · Beginner
Includes a short, careful section on the superuser and when to use sudo
Practise
Keep handy
Also worth your time
- roadmap.sh: LinuxGo deeper
See the users, permissions and process management branches of the Linux map