LX0-103 · Question #207
Which shell command is used to continue background execution of a suspended command?
The correct answer is B. bg. The 'bg' shell built-in resumes a stopped job and continues its execution in the background, equivalent to having originally launched it with an ampersand.
Question
Which shell command is used to continue background execution of a suspended command?
Options
- A&
- Bbg
- Ccont
- Dexec
- E:&
How the community answered
(58 responses)- A3% (2)
- B88% (51)
- C2% (1)
- E7% (4)
Why each option
The 'bg' shell built-in resumes a stopped job and continues its execution in the background, equivalent to having originally launched it with an ampersand.
The '&' operator is appended to a command at launch time to start it in the background initially; it cannot be used to resume an already-suspended job.
The 'bg' built-in sends SIGCONT to a suspended job (typically stopped with Ctrl+Z) and places it in the background, returning the shell prompt while the job continues executing.
'cont' is not a standard shell built-in or POSIX-defined command; sending SIGCONT to a process requires 'kill -CONT' or the 'bg' built-in.
'exec' replaces the current shell process with a new program and is entirely unrelated to job control or resuming suspended processes.
':&' is not recognized shell syntax for job control; the colon ':' is the null command and this combination does not resume suspended jobs.
Concept tested: Shell job control - resuming suspended jobs in background
Source: https://www.gnu.org/software/bash/manual/bash.html#Job-Control-Builtins
Topics
Community Discussion
No community discussion yet for this question.