CompTIA Linux+ Practice Questions: More Practice Questions

20 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering More Practice Questions, each with the correct answer and an explanation. Start a timed exam below, or scroll on to read through the questions.

🧠

Mini Exam

25 Questions · 50 minutes

Start Quiz 🚀
🏆

Mock Linux+ Exam

85 Questions · 165 minutes

Start Quiz 🚀
📅

Daily Quiz

10 Questions · 20 minutes

Start Quiz 🚀
🎯

Standard Practice

50 Questions · 100 minutes

Start Quiz 🚀

More Practice Questions practice questions

Answers and explanations are shown. Take the timed exam above to test yourself first.

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

  • A.Prevent process termination on logout✓ Correct
  • B.Monitor CPU usage
  • C.Encrypt files
  • D.Manage user groups
Explanation: nohup keeps processes running after terminal disconnection. Learn more.

Q2. What does 'kill -9' do?

  • A.Gracefully terminate process
  • B.Force immediate termination✓ Correct
  • C.Reload configuration
  • D.Pause process
Explanation: SIGKILL (9) cannot be ignored by processes. Learn more.

Q3. Which command shows process hierarchy?

  • A.pstree✓ Correct
  • B.ps aux
  • C.top
  • D.htop
Explanation: pstree displays processes in tree format. Learn more.

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

  • A.nice --existing
  • B.nohup
  • C.disown
  • D.renice✓ Correct
Explanation: renice changes the scheduling priority of an existing process by updating its nice value. Learn more.

Q5. Which file defines default useradd settings?

  • A./etc/login.defs
  • B./etc/passwd
  • C./etc/default/useradd✓ Correct
  • D./etc/skel/
Explanation: /etc/default/useradd controls user creation defaults. Learn more.

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

  • A.Add user to group✓ Correct
  • B.Change user password
  • C.Delete user account
  • D.Modify UID
Explanation: -aG appends user to supplementary groups. Learn more.

Q7. Which file defines default shell?

  • A./etc/passwd✓ Correct
  • B./etc/shells
  • C./etc/profile
  • D./etc/bashrc
Explanation: Last field in /etc/passwd specifies user's shell. Learn more.

Q8. What does 'userdel -r' do?

  • A.Remove user's home directory✓ Correct
  • B.Reset password
  • C.Reload user cache
  • D.Delete group
Explanation: -r removes home dir and mail spool. Learn more.

Q9. Which file defines kernel parameters at boot?

  • A./etc/sysctl.conf
  • B./proc/cmdline
  • C./boot/grub/grub.cfg✓ Correct
  • D./etc/kernel/postinst.d
Explanation: GRUB configuration passes parameters via /boot/grub/grub.cfg. Learn more.

Q10. What does 'sysctl -w' do?

  • A.Write kernel parameters temporarily✓ Correct
  • B.Write to syslog
  • C.Wipe system configuration
  • D.Watch process changes
Explanation: Modifies kernel parameters at runtime. Learn more.

Q11. Which directory contains DKMS kernel modules?

  • A./usr/src
  • B./lib/modules
  • C./var/lib/dkms✓ Correct
  • D./etc/dkms
Explanation: DKMS stores built modules in /var/lib/dkms. Learn more.

Q12. Which directory contains modprobe configuration files?

  • A./etc/modprobe.d✓ Correct
  • B./lib/modules
  • C./etc/sysconfig/modules
  • D./proc/modules
Explanation: modprobe.d contains kernel module options. Learn more.

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

  • A.$?✓ Correct
  • B.$HOME
  • C.$PATH
  • D.$SHELL
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?

  • A.> file 2>&1✓ Correct
  • B.< file 1<2
  • C.| file
  • D.>> /dev/null <&0 only
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?

  • A.strace
  • B.ShellCheck✓ Correct
  • C.ldd
  • D.logrotate
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?

  • A.Invert match
  • B.Case-insensitive search✓ Correct
  • C.Show line numbers
  • D.Recursive search
Explanation: -i makes the search case-insensitive. Learn more.

Q17. What does 'grep -v' do?

  • A.Invert match✓ Correct
  • B.Verbose output
  • C.Show version
  • D.Recursive search
Explanation: -v selects non-matching lines. Learn more.

Q18. Which Git command stages all modified files?

  • A.git add .✓ Correct
  • B.git commit
  • C.git push
  • D.git stage
Explanation: git add . stages current directory changes. Learn more.

Q19. Which directory holds Apache virtual host configurations?

  • A./etc/httpd/conf.d/
  • B./var/www/html
  • C./usr/lib/apache2
  • D./etc/apache2/sites-available/✓ Correct
Explanation: Debian-based systems use sites-available/ and sites-enabled/. Learn more.

Q20. Which directory contains cloud-init configurations?

  • A./etc/cloud
  • B./var/lib/cloud
  • C./usr/share/cloud-init
  • D.All of the above✓ Correct
Explanation: Cloud-init uses multiple directories for initialization. Learn more.

More CompTIA Linux+ practice topics

Keep studying CompTIA Linux+

Full CompTIA Linux+ practice exam · CompTIA Linux+ study guide · All CompTIA practice questions

Last updated