CompTIA Linux+ Practice Questions: More Practice Questions

20 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering More Practice Questions. Each question shows the correct answer and a clear explanation. Ready for the real thing? Take the full timed quiz below.

🚀 Take the full CompTIA Linux+ quiz 📘 CompTIA Linux+ study guide

Q1. What is the purpose of the 'nohup' command?

Explanation: nohup keeps processes running after terminal disconnection. Learn more.

Q2. What does 'kill -9' do?

Explanation: SIGKILL (9) cannot be ignored by processes. Learn more.

Q3. Which command shows process hierarchy?

Explanation: pstree displays processes in tree format. Learn more.

Q4. Which command changes the nice value of an already running process?

Explanation: renice changes the scheduling priority of an existing process by updating its nice value. Learn more.

Q5. Which file defines default useradd settings?

Explanation: /etc/default/useradd controls user creation defaults. Learn more.

Q6. What is the purpose of 'usermod -aG'?

Explanation: -aG appends user to supplementary groups. Learn more.

Q7. Which file defines default shell?

Explanation: Last field in /etc/passwd specifies user's shell. Learn more.

Q8. What does 'userdel -r' do?

Explanation: -r removes home dir and mail spool. Learn more.

Q9. Which file defines kernel parameters at boot?

Explanation: GRUB configuration passes parameters via /boot/grub/grub.cfg. Learn more.

Q10. What does 'sysctl -w' do?

Explanation: Modifies kernel parameters at runtime. Learn more.

Q11. Which directory contains DKMS kernel modules?

Explanation: DKMS stores built modules in /var/lib/dkms. Learn more.

Q12. Which directory contains modprobe configuration files?

Explanation: modprobe.d contains kernel module options. Learn more.

Q13. Which Bash construct stores the exit status of the most recent command?

Explanation: $? expands to the exit status of the last foreground pipeline or command. Learn more.

Q14. Which Bash redirection sends both standard output and standard error to the same file?

Explanation: 2>&1 redirects standard error to the same destination as standard output. Learn more.

Q15. Which tool performs static analysis on shell scripts and reports common quoting, portability, and logic problems?

Explanation: ShellCheck analyzes shell scripts without executing them and reports common errors, risky expansions, and portability concerns. Learn more.

Q16. What does 'grep -i' do?

Explanation: -i makes the search case-insensitive. Learn more.

Q17. What does 'grep -v' do?

Explanation: -v selects non-matching lines. Learn more.

Q18. Which Git command stages all modified files?

Explanation: git add . stages current directory changes. Learn more.

Q19. Which directory holds Apache virtual host configurations?

Explanation: Debian-based systems use sites-available/ and sites-enabled/. Learn more.

Q20. Which directory contains cloud-init configurations?

Explanation: Cloud-init uses multiple directories for initialization. Learn more.

More CompTIA Linux+ practice topics