Ctrl+Z stopped job 1, and jobs shows it as Stopped.
Resume that job in the background.
Which command is appropriate?
bg %1 resumes job 1 in the background. Ctrl+Z normally stops the foreground job with SIGTSTP.
Detailed explanation
fg %1Incorrect. fg would resume job 1 in the foreground.
Incorrect. fg would resume job 1 in the foreground.
bg %1Correct. bg %1 resumes the stopped job in the background.
Correct. bg %1 resumes the stopped job in the background.
jobs %1Incorrect. jobs lists jobs rather than resuming one.
Incorrect. jobs lists jobs rather than resuming one.
wait %1Incorrect. wait waits for a job rather than continuing it in the background.
Incorrect. wait waits for a job rather than continuing it in the background.
Try it yourself
An example you can run in a temporary verification environment.
help bgExpected result
Bash builtin bgのhelpKey points
- Ctrl+Z
- Stopped
- bg
Notes
- Environment: Bash 5.x builtin help
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.