1
CompTIA Linux+ (XK0-
005) Advanced Practice
Examination v2.0 a well
detailed one 2025 /
2026 written and graded
A+ upgraded
Exam Title: CompTIA Linux+ XK0-005 Certification Practice Exam — Advanced Scenario-Based
Questions Covering System Management, Security, Automation, and Troubleshooting for IT
Professionals
Domain 1: System Management (32% of Exam) — Questions 1–48
Linux Fundamentals and File Management
, 2
Question 1
A Linux administrator needs to locate all files in /var/log that have been modified in the last 7
days and are larger than 10 MB. Which command accomplishes this?
A. find /var/log -type f -size +10M -mtime -7
B. find /var/log -type f -size +10M -mtime +7
C. find /var/log -type f -size 10M -mtime -7
D. find /var/log -type f -size +10M -ctime -7
-” detailed answer 100 % correct :-”A
Rationale: -size +10M finds files larger than 10 MB, -mtime -7 finds files modified less than 7
days ago (i.e., within the last 7 days). -mtime +7 would find files older than 7 days. -ctime checks
change time, not modification time.
Question 2
An administrator needs to create a hard link to /usr/bin/python3 in /usr/local/bin/python3.
Which command is correct?
A. ln /usr/bin/python3 /usr/local/bin/python3
B. ln -s /usr/bin/python3 /usr/local/bin/python3
C. cp -l /usr/bin/python3 /usr/local/bin/python3
D. Both A and C
-” detailed answer 100 % correct :-”A
Rationale: ln without -s creates a hard link. ln -s creates a symbolic link. cp -l creates hard links
but is less commonly used for this purpose. Hard links cannot cross filesystem boundaries.
Question 3
Which command displays the first 15 lines of a file and continuously monitors for new content?
A. tail -f -n 15 file
B. head -f -n 15 file
C. tail -F -n 15 file
D. less +F -n 15 file
-” detailed answer 100 % correct :-”A
, 3
Rationale: tail -f -n 15 displays the last 15 lines and follows new content. head does not have a
follow option. -F follows by filename (useful for log rotation) but -f is sufficient for standard
monitoring.
Question 4
Which file system feature in Linux allows for the creation of a filesystem that spans multiple
physical devices without using LVM?
A. RAID
B. Btrfs
C. ZFS
D. All of the above
-” detailed answer 100 % correct :-”D
Rationale: RAID, Btrfs, and ZFS all support spanning multiple physical devices. Btrfs and ZFS are
advanced filesystems with built-in volume management capabilities.
Question 5
Which command shows the SELinux context of a file?
A. ls -Z file
B. stat file
C. ls -l file
D. Both A and B
-” detailed answer 100 % correct :-”D
Rationale: Both ls -Z and stat display SELinux contexts. ls -l shows standard permissions but not
SELinux contexts.
Package Management (Advanced)
Question 6
A Debian administrator needs to find which package provides the /usr/lib/x86_64-linux-
gnu/libssl.so.1.1 library. Which command should be used?
A. dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1
B. apt-file search /usr/lib/x86_64-linux-gnu/libssl.so.1.1
, 4
C. dpkg -L libssl
D. Both A and B
-” detailed answer 100 % correct :-”D
Rationale: dpkg -S searches for the package owning a file. apt-file search also finds which
package provides a file. dpkg -L lists files in a package, not the reverse lookup.
Question 7
Which DNF command displays the change logs for a package?
A. dnf changelog package-name
B. dnf history package-name
C. rpm -q --changelog package-name
D. Both A and C
-” detailed answer 100 % correct :-”D
Rationale: dnf changelog and rpm -q --changelog both display package change logs. dnf
history shows transaction history, not change logs.
Question 8
Which command lists all files installed by a package on a Debian-based system?
A. dpkg -L package-name
B. dpkg -l package-name
C. apt-cache show package-name
D. dpkg -s package-name
-” detailed answer 100 % correct :-”A
Rationale: dpkg -L lists all files installed by a package. dpkg -l lists installed packages. apt-cache
show displays package information. dpkg -s shows package status.
Question 9
A system administrator needs to rebuild the RPM database on a RHEL-based system. Which
command accomplishes this?
CompTIA Linux+ (XK0-
005) Advanced Practice
Examination v2.0 a well
detailed one 2025 /
2026 written and graded
A+ upgraded
Exam Title: CompTIA Linux+ XK0-005 Certification Practice Exam — Advanced Scenario-Based
Questions Covering System Management, Security, Automation, and Troubleshooting for IT
Professionals
Domain 1: System Management (32% of Exam) — Questions 1–48
Linux Fundamentals and File Management
, 2
Question 1
A Linux administrator needs to locate all files in /var/log that have been modified in the last 7
days and are larger than 10 MB. Which command accomplishes this?
A. find /var/log -type f -size +10M -mtime -7
B. find /var/log -type f -size +10M -mtime +7
C. find /var/log -type f -size 10M -mtime -7
D. find /var/log -type f -size +10M -ctime -7
-” detailed answer 100 % correct :-”A
Rationale: -size +10M finds files larger than 10 MB, -mtime -7 finds files modified less than 7
days ago (i.e., within the last 7 days). -mtime +7 would find files older than 7 days. -ctime checks
change time, not modification time.
Question 2
An administrator needs to create a hard link to /usr/bin/python3 in /usr/local/bin/python3.
Which command is correct?
A. ln /usr/bin/python3 /usr/local/bin/python3
B. ln -s /usr/bin/python3 /usr/local/bin/python3
C. cp -l /usr/bin/python3 /usr/local/bin/python3
D. Both A and C
-” detailed answer 100 % correct :-”A
Rationale: ln without -s creates a hard link. ln -s creates a symbolic link. cp -l creates hard links
but is less commonly used for this purpose. Hard links cannot cross filesystem boundaries.
Question 3
Which command displays the first 15 lines of a file and continuously monitors for new content?
A. tail -f -n 15 file
B. head -f -n 15 file
C. tail -F -n 15 file
D. less +F -n 15 file
-” detailed answer 100 % correct :-”A
, 3
Rationale: tail -f -n 15 displays the last 15 lines and follows new content. head does not have a
follow option. -F follows by filename (useful for log rotation) but -f is sufficient for standard
monitoring.
Question 4
Which file system feature in Linux allows for the creation of a filesystem that spans multiple
physical devices without using LVM?
A. RAID
B. Btrfs
C. ZFS
D. All of the above
-” detailed answer 100 % correct :-”D
Rationale: RAID, Btrfs, and ZFS all support spanning multiple physical devices. Btrfs and ZFS are
advanced filesystems with built-in volume management capabilities.
Question 5
Which command shows the SELinux context of a file?
A. ls -Z file
B. stat file
C. ls -l file
D. Both A and B
-” detailed answer 100 % correct :-”D
Rationale: Both ls -Z and stat display SELinux contexts. ls -l shows standard permissions but not
SELinux contexts.
Package Management (Advanced)
Question 6
A Debian administrator needs to find which package provides the /usr/lib/x86_64-linux-
gnu/libssl.so.1.1 library. Which command should be used?
A. dpkg -S /usr/lib/x86_64-linux-gnu/libssl.so.1.1
B. apt-file search /usr/lib/x86_64-linux-gnu/libssl.so.1.1
, 4
C. dpkg -L libssl
D. Both A and B
-” detailed answer 100 % correct :-”D
Rationale: dpkg -S searches for the package owning a file. apt-file search also finds which
package provides a file. dpkg -L lists files in a package, not the reverse lookup.
Question 7
Which DNF command displays the change logs for a package?
A. dnf changelog package-name
B. dnf history package-name
C. rpm -q --changelog package-name
D. Both A and C
-” detailed answer 100 % correct :-”D
Rationale: dnf changelog and rpm -q --changelog both display package change logs. dnf
history shows transaction history, not change logs.
Question 8
Which command lists all files installed by a package on a Debian-based system?
A. dpkg -L package-name
B. dpkg -l package-name
C. apt-cache show package-name
D. dpkg -s package-name
-” detailed answer 100 % correct :-”A
Rationale: dpkg -L lists all files installed by a package. dpkg -l lists installed packages. apt-cache
show displays package information. dpkg -s shows package status.
Question 9
A system administrator needs to rebuild the RPM database on a RHEL-based system. Which
command accomplishes this?