CompTIA Linux+ — Practice Questions flashcards
6 of 60 questions free to study here · 4 topics · the whole deck is built into Willys
Multiple-choice practice questions, one best answer each, on systemd, packages, LVM, users and permissions, SSH, sudo, SELinux, firewalls, scripting, containers and troubleshooting.
Practice deck · part of CompTIA Linux+ · written against: Current Linux+ exam objectives (topics common to XK0-005 and its successor). Updated 2026-10-10.
Study the free sample
6 questions from the deck as they are. Flip, rate yourself, filter by topic; your progress stays in this browser.
Tap the card or press Space to flip
The 6 sample questions as a list
-
A developer compiles a monitoring tool from source on a production server. Its files must not collide with files owned by the distribution's packages. Where should the tool be installed?
A) Under /srv
B) Under /usr/share
C) Under /usr/bin
D) Under /usr/localD) Under /usr/localSystem Management › Filesystem Hierarchy
By FHS convention /usr/local is for locally built software that the package manager does not track, so package updates never touch it. /usr/bin belongs to the distribution's packages, and an update could overwrite or conflict with files placed there.
Not in the CompTIA Linux+ 2026 outline; background only. -
An application writes scratch files that must still be there after the server reboots. Which directory suits them?
A) /run
B) /tmp
C) /dev/shm
D) /var/tmpD) /var/tmpSystem Management › Filesystem Hierarchy
/var/tmp is meant for temporary files that persist across reboots. /tmp may be cleared at every boot and is often a RAM-backed tmpfs, and /run and /dev/shm are RAM-backed as well.
Not in the CompTIA Linux+ 2026 outline; background only. -
User alice must also join the docker group without losing any of her existing supplementary groups. Which command does this?
A)usermod -G docker alice
B)useradd -G docker alice
C)usermod -g docker alice
D)usermod -aG docker aliceD)Security › Users and Groupsusermod -aG docker alice
-a appends to the supplementary group list. -G on its own replaces the whole list, and -g changes her primary group; she must log in again before the new membership applies. -
A help-desk technician has reset user bob's password and wants the system to make bob choose a new one at his next login. Which command does this?
A)chage -l bob
B)usermod -L bob
C)chage -E 0 bob
D)chage -d 0 bobD)Security › Users and Groupschage -d 0 bob
chage -d 0 sets the last password change to day zero, so the password counts as expired and must be changed at login. chage -E 0 expires the whole account, which blocks login altogether. -
A cron job runs ./backup.sh, and both its normal output and its error messages must end up in backup.log. Which command line does this?
A)./backup.sh > backup.log 1>&2
B)./backup.sh > backup.log 2>&1
C)./backup.sh 2> backup.log
D)./backup.sh 2>&1 > backup.logB)Scripting Containers and Automation › Bash Scripting./backup.sh > backup.log 2>&1
Redirections are processed left to right: stdout goes to the file first, then 2>&1 points stderr at the same place. Written the other way round, stderr is copied from stdout before stdout is redirected, so errors still go to the old destination. -
Which command shows only messages of priority error and more severe from the current boot?
A)journalctl -b -p err
B)journalctl -k -p err
C)journalctl -b -1 -p err
D)journalctl -f -p errA)Troubleshooting › Logsjournalctl -b -p err
-b limits the output to the current boot and -p err to error and higher priorities. -b -1 selects the previous boot instead, and -k shows only kernel messages.
Unlock the whole deck
You are studying a free 6-question sample. All 60 questions of CompTIA Linux+ — Practice Questions, the other 2 CompTIA Linux+ decks, and spaced-repetition scheduling are built into Willys. 14-day free trial, then $14.99 a year.
In Willys, tap Exam Library at the top of your Decks (or Browse Exam Library… under the + button), find the exam on its shelf or by search, tick it and tap Add.
More CompTIA Linux+ decks
← All CompTIA Linux+ decks, with the study guide and topic outline.
About these cards
Review status: Second-reader reviewed, with corrections applied.
Checked against:
- CompTIA Linux+ exam objectives — topic outline only; no text copied. Tags follow the four XK0-005 domains; as of October 2026 the current exam is XK0-006 (launched 2025-07-15), and XK0-005 retired on 2026-01-13.
These are independent study notes written for Willys. They are not official exam material, may contain mistakes, and are no substitute for your course, your teacher or the exam owner's own publications. Found an error? Tell us — corrections ship as a new version of the deck.
CompTIA® and Linux+® are registered trademarks of CompTIA, Inc. Linux® is the registered trademark of Linus Torvalds. This product is not affiliated with or endorsed by CompTIA.
Use of these pages is covered by our Terms of Use.