nerdexam
CompTIA

XK0-005 · Question #378

A Linux administrator needs to run a command in the background of a terminal, Which of the following commands will BEST accomplish this task?

The correct answer is A. ./run_application $$ bg. The bg command is used in job control to move a suspended foreground job into the background, allowing it to continue execution without occupying the terminal.

System Management

Question

A Linux administrator needs to run a command in the background of a terminal, Which of the following commands will BEST accomplish this task?

Options

  • A./run_application $$ bg
  • B./run_application +$
  • C./run_application
  • D./run_application $

How the community answered

(29 responses)
  • A
    86% (25)
  • B
    3% (1)
  • C
    7% (2)
  • D
    3% (1)

Why each option

The `bg` command is used in job control to move a suspended foreground job into the background, allowing it to continue execution without occupying the terminal.

A./run_application $$ bgCorrect

The `bg` command is specifically used in shell job control to take a stopped process and move it to the background, allowing it to continue execution while freeing up the terminal. Although the `$$` part of the command is unusual in this context, the presence of `bg` is the only option that directly relates to running a command in the background after it has been initiated.

B./run_application +$

`./run_application +$` is not a valid or standard command for running an application in the background; the `+` and `$` symbols do not serve this purpose. C: `./run_application` runs the application in the foreground, blocking the terminal until it completes or is manually suspended. D: `./run_application $` runs the application in the foreground, passing the value of the last argument as an additional argument, and does not background the process.

C./run_application
D./run_application $

Concept tested: Linux shell job control (bg command)

Source: https://man7.org/linux/man-pages/man1/bash.1.html

Topics

#Linux job control#Background processes#bg command#Shell commands

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice