LX0-103 · Question #38
Given the following output: prompt> myapp [1]+ Stopped myapp prompt> Which of the following commands will resume executing the stopped process while allowing the user to continue to type commands at…
The correct answer is A. bg myapp. The 'bg' command resumes a stopped job by running it in the background, freeing the shell prompt for further input.
Question
Given the following output:
prompt> myapp [1]+ Stopped myapp prompt> Which of the following commands will resume executing the stopped process while allowing the user to continue to type commands at the command prompt?
Options
- Abg myapp
- Bcontinue myapp
- Cexec myapp
- Dfg myapp
- Emyapp &
How the community answered
(52 responses)- A88% (46)
- B2% (1)
- D8% (4)
- E2% (1)
Why each option
The 'bg' command resumes a stopped job by running it in the background, freeing the shell prompt for further input.
The 'bg' built-in sends a stopped job to the background by delivering SIGCONT to the process group, allowing execution to resume. Because the job runs in the background, the shell prompt remains available for the user to enter additional commands. Job identifiers or command names can be passed as arguments to 'bg'.
'continue' is a shell loop control keyword used inside for/while loops to skip to the next iteration - it cannot resume a stopped process.
'exec' replaces the current shell process with a specified command - it does not resume a stopped background job.
'fg' resumes a stopped job in the foreground, which means the terminal is attached to that process and the user cannot type other commands until it finishes.
Appending '&' starts a brand-new instance of the program rather than resuming the existing stopped process identified by job number [1].
Concept tested: Linux job control - resuming stopped 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.