LFCS · Question #851
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. To resume a stopped process and run it in the background, the bg command is used, allowing the user to continue typing commands at the prompt.
Question
Options
- Abg myapp
- Bcontinue myapp
- Cexec myapp
- Dfg myapp
- Emyapp &
How the community answered
(32 responses)- A88% (28)
- C6% (2)
- D3% (1)
- E3% (1)
Why each option
To resume a stopped process and run it in the background, the `bg` command is used, allowing the user to continue typing commands at the prompt.
A is correct because the `bg` command (background) takes a stopped job (identified by its job number or name) and resumes its execution in the background, releasing the terminal prompt for the user to execute other commands. This is evident from the `[1]+ Stopped myapp` output, indicating `myapp` is job 1 and is stopped.
`continue` is not a standard shell command for resuming stopped jobs in the background.
`exec myapp` would replace the current shell with `myapp`, terminating the current session and not putting `myapp` in the background.
`fg myapp` (foreground) would resume the process but bring it to the foreground, meaning it would occupy the terminal and block further command input until it finishes or is stopped again.
`myapp &` would start `myapp` in the background *initially*, but the process is already stopped; this command would attempt to start a *new* instance of `myapp`.
Concept tested: Job control (backgrounding processes)
Source: https://man7.org/linux/man-pages/man1/bash.1.html
Topics
Community Discussion
No community discussion yet for this question.