Linux Administration
medium

Pregunta de Linux Administration #019e3987

Enunciado de la Pregunta
Linux Administration
#bg
#job-control
#sigtstp
#sigcont
#suspended-job
Medio

Which shell command is used to continue background execution of a suspended command?

A

&

B

bg

Correcto
C

cont

D

exec

E

:&

Explicación Oficial / Explicaciones de la Comunidad

The bg command is used to resume a suspended job and run it in the background. When a command is suspended (e.g., by pressing Ctrl+Z), it is stopped and placed into a suspended state. The bg command takes that suspended job and continues its execution in the background, allowing the shell to accept new commands immediately.

How it Works

  • Suspending a job: Pressing Ctrl+Z sends SIGTSTP to the foreground process, stopping it. The shell then reports the job number and its state (suspended).
  • Using bg: Typing bg (optionally with a job ID like %1) resumes the job in the background. The shell sends SIGCONT to the process group, and the job continues running but does not have control of the terminal.
  • The & operator is used to start a command directly in the background, not to resume a suspended one.
  • cont is not a standard shell command; it is a misspelling of continue in some contexts but not for job control.
  • exec replaces the current shell with a new command; it does not resume background jobs.
  • :& is not a valid shell command; : is a null command, and appending & would attempt to run it in the background, but it does not resume a suspended job.