0
0
Linux CLIscripting~5 mins

Background processes (&) in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the ampersand (&) symbol do when added at the end of a command in Linux?
It runs the command as a background process, allowing you to continue using the terminal without waiting for the command to finish.
Click to reveal answer
beginner
How can you check the list of background jobs running in your current shell session?
Use the jobs command to see all background jobs with their job numbers and statuses.
Click to reveal answer
beginner
What command brings a background job back to the foreground?
Use fg %job_number to bring a specific background job to the foreground.
Click to reveal answer
beginner
Why would you want to run a process in the background?
To keep the terminal free for other commands while a long-running task continues without blocking your work.
Click to reveal answer
intermediate
What happens if you close the terminal while a background process is running?
The background process usually stops unless it was started with tools like nohup or inside a terminal multiplexer like screen or tmux.
Click to reveal answer
What does adding '&' at the end of a command do?
ARuns the command in the background
BStops the command immediately
CRuns the command with higher priority
DRuns the command in a new terminal window
Which command lists all background jobs in the current shell?
Ajobs
Bps
Cbg
Dfg
How do you bring a background job with job number 2 to the foreground?
Ajobs %2
Bbg %2
Cfg %2
Dkill %2
What happens to background processes if you close the terminal without precautions?
AThey keep running forever
BThey stop running
CThey restart automatically
DThey become foreground processes
Which tool can keep a process running after terminal closes?
Ajobs
Bfg
Ckill
Dnohup
Explain how to run a command in the background and how to check its status.
Think about how to free your terminal while a task runs.
You got /2 concepts.
    Describe how to bring a background process back to the foreground and why you might want to do that.
    Remember the command that resumes control of a background job.
    You got /2 concepts.