XK0-006 practice question 6 of 15
A Linux user runs the following command: nohup ping comptia.com & Which of the following commands should the user execute to attach the process to the current terminal?
Full set: 149 questionsThe nohup command ensures a process continues running even if the user logs out, and the & operator places the process into the background. The jobs command lists background processes. To bring a background process to the foreground and attach it to the current terminal session, the fg (foreground) command is used. This allows the user to interact with the process or view its standard output directly in the terminal.
A. renice is used to change the scheduling priority of a running process, not to attach it to a terminal.
B. jobs lists the background processes but does not attach any of them to the foreground.
C. exec replaces the current shell process with a new command, which is not the desired action.
1. GNU Bash Manual, Section 3.2.2 "Job Control Basics". The manual states, "To move a job to the foreground, use the fg command."
2. Arpaci-Dusseau, R. H., & Arpaci-Dusseau, A. C. (2018). Operating Systems: Three Easy Pieces. Arpaci-Dusseau Books. Chapter 5, "Processes API", discusses process control, including backgrounding and foregrounding processes.
3. MIT OpenCourseWare, 6.005 Software Construction, "Command Line" reading. This material covers shell basics, including job control with &, jobs, bg, and fg.
Keep practicing
Take the free XK0-006 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other XK0-006 practice questions
- Question 1A DevOps engineer needs to create a local Git repository. Which of the following commands…
- Question 2Which of the following is the main reason for setting up password expiry policies?
- Question 3A Linux administrator needs to securely erase the contents of a hard disk. Which of the f…
- Question 4Which of the following best describes the role of initrd?
- Question 5Which of the following is a characteristic of Python 3?
- Question 7A systems administrator needs to enable routing of IP packets between network interfaces.…
