Recall & Review
beginner
What does the
fg command do in Linux?The
fg command brings a background job to the foreground, letting you interact with it directly.Click to reveal answer
beginner
What is the purpose of the
bg command?The
bg command resumes a stopped job in the background, allowing it to keep running without blocking the terminal.Click to reveal answer
beginner
How do you list all current jobs in the shell?
Use the
jobs command to see all running or stopped jobs with their job numbers.Click to reveal answer
intermediate
How do you bring a specific job to the foreground using
fg?Use
fg %job_number, for example fg %1 to bring job number 1 to the foreground.Click to reveal answer
beginner
What happens if you press Ctrl+Z while a command is running?
Pressing Ctrl+Z stops (pauses) the running command and puts it in the background as a stopped job.
Click to reveal answer
Which command resumes a stopped job in the background?
✗ Incorrect
The
bg command resumes a stopped job in the background.What does
fg %2 do?✗ Incorrect
fg %2 brings job number 2 to the foreground.How do you see all current jobs in the shell?
✗ Incorrect
The
jobs command lists all current jobs.What key combination stops a running job and puts it in the background?
✗ Incorrect
Pressing Ctrl+Z stops the job and puts it in the background as stopped.
If you want to interact with a background job, which command should you use?
✗ Incorrect
Use
fg to bring a background job to the foreground for interaction.Explain how to pause a running command and then resume it in the background.
Think about keyboard shortcuts and job control commands.
You got /3 concepts.
Describe the difference between
fg and bg commands.Consider how you want to use the job after resuming it.
You got /4 concepts.