Troubleshooting for CompTIA Linux+
This page covers the Troubleshooting domain of the CompTIA Linux+ certification. Master Cybersecurity offers 118 practice questions in this domain, drawn from the same content we use across our timed exam simulations. Below are five sample questions with full answer explanations.
Sample Practice Questions
Question 1
The journald entries have filled a Linux machine's /var volume. Which of the following is the best command for a systems administrator to use to free up the disk space occupied by these entries?- A. journalctl ---rotate journalctl --vacuum-time=ls
- B. systemctl stop systemd-journald systemctl start systemd-journald
- C. rm -rf /var/log/journal systemctl restart systemd-journald
- D. pkill -HUP systemd-journald systemctl restart systemd-journald
Explanation
The correct answer is: B. systemctl stop systemd-journald systemctl start systemd-journald.
The correct answer is B (systemctl stop systemd-journald; systemctl start systemd-journald) because stopping and restarting the journald service causes it to rotate log files, which moves old journal entries to archived files and frees up space in the active journal. This is a safe way to manage journald logs without losing all log data. Option A syntax appears corrupted (--rotate journalctl --vacuum-time=ls). Option C (rm -rf /var/log/journal) deletes all journal logs permanently, which is too destructive.Question 2
A Linux server in a hybrid cloud environment is experiencing slow performance. You suspect high CPU usage by a container. Which command would help you identify the container causing the issue?- A. docker stats
- B. top
- C. ps aux
- D. vmstat
Explanation
The correct answer is: A. docker stats.
**docker stats** shows live resource usage (CPU, memory, network, block I/O) per container and helps identify which container is causing high CPU. top and ps aux show host processes; vmstat shows system-wide stats. Use docker stats to troubleshoot container resource usage.Question 3
A cloud-based CentOS server is experiencing intermittent connectivity issues. Which command would help diagnose potential network problems?- A. ping -c 4 google.com
- B. traceroute google.com
- C. ifconfig eth0
- D. netstat -rn
Explanation
The correct answer is: A. ping -c 4 google.com.
**ping -c 4 google.com** tests reachability and latency to a host; -c 4 sends four packets. Useful for intermittent connectivity. traceroute shows the path; ifconfig shows interface config; netstat -rn shows routing. Start with ping to confirm basic connectivity.Question 4
A Linux system administrator is investigating the source of increased CP utilization on a server and identifies a single process with a process ID of 62 68 and a nice value of five as the culprit among the options given which command is most likely to rectify the problem?- A. renice -n -10 -p 6268
- B. nice -n -10 6268
- C. kill -9 6268
- D. chrt -f -p 50 6268
Explanation
The correct answer is: A. renice -n -10 -p 6268.
`renice -n -10 -p 6268` changes the nice value of the existing process (PID 6268) to -10, giving it higher priority. This addresses the high CPU usage by increasing process priority. Option B sets nice for a new process. Option C kills the process. Option D uses real-time scheduling. making "renice -n -10 -p 6268" the correct answer.Question 5
A user reports that their home directory is not accessible. Upon investigation, you find a permission issue. Which command can you use to reset the home directory permissions for the user 'john'?- A. chmod 755 /home/john
- B. chown john:john /home/john
- C. chmod 700 /home/john
- D. chown root:john /home/john
Explanation
The correct answer is: B. chown john:john /home/john.
To fix a home directory permission issue, set **correct ownership** with **chown john:john /home/john** so the user owns their home. chmod 755 or 700 sets permissions; chown root:john would make root the owner. Fix ownership first with chown user:user /home/user; then set permissions (e.g., 700) if needed.
Other CompTIA Linux+ domains
- Scripting, Containers, and Automation (176 questions)
- Security (135 questions)
- System Management (172 questions)