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.
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)- A86% (25)
- B3% (1)
- C7% (2)
- D3% (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.
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.
`./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.
Concept tested: Linux shell job control (bg command)
Source: https://man7.org/linux/man-pages/man1/bash.1.html
Topics
Community Discussion
No community discussion yet for this question.