nerdexam
CompTIA

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.

GNU and Unix Commands

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)
  • A
    88% (46)
  • B
    2% (1)
  • D
    8% (4)
  • E
    2% (1)

Why each option

The 'bg' command resumes a stopped job by running it in the background, freeing the shell prompt for further input.

Abg myappCorrect

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'.

Bcontinue myapp

'continue' is a shell loop control keyword used inside for/while loops to skip to the next iteration - it cannot resume a stopped process.

Cexec myapp

'exec' replaces the current shell process with a specified command - it does not resume a stopped background job.

Dfg myapp

'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.

Emyapp &

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

#job control#bg command#background process#process management

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice