nerdexam
CompTIA

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.

GNU and Unix Commands

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)
  • A
    3% (2)
  • B
    88% (51)
  • C
    2% (1)
  • E
    7% (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.

A&

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.

BbgCorrect

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.

Ccont

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

Dexec

'exec' replaces the current shell process with a new program and is entirely unrelated to job control or resuming suspended processes.

E:&

':&' 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

#bg#job control#background process#shell

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice