CompTIA Linux+ (XK0-004) — Question 15
After starting a long-running script, a systems administrator needs to verify the frequency of what is filling up the /var partition and kill it because it is consuming too much space.
Which of the following is the correct sequence given only a terminal is available?
Answer options
- A. 1. CTRL-C 2. bg 3. watch df /var 4. CTRL-C 5. fg 6. CTRL-Z
- B. 1. CTRL-C 2. fg 3. watch df /var 4. CTRL-Z 5. bg 6. CTRL-Z
- C. 1. CTRL-Z 2. bg 3. watch df /var 4. CTRL-C 5. fg 6. CTRL-C
- D. 1. CTRL-Z 2. bg 3. watch df /var 4. CTRL-Z 5. fg 6. CTRL-C
Correct answer: D
Explanation
The correct sequence starts with CTRL-Z to suspend the script, then bg to run it in the background. The command watch df /var allows the administrator to monitor the partition usage, and upon identifying the issue, fg brings the script back to the foreground, where CTRL-C can be used to terminate it. The other options either incorrectly use CTRL-C before suspending the script or do not properly sequence the commands needed to monitor and then terminate the process.