Free XK0-005: CompTIA Linux Exam Questions and Answers
CompTIA Linux is exam XK0-005, part of the CompTIA certification programme. CompTIA exam codes carry a family prefix and a version number — SY0- for Security+, N10- for Network+, CS0- for CySA+, 220- for A+ — and most Plus-series exams allow 90 minutes for up to 90 questions, mixing multiple choice with performance-based items in a simulated environment.
Candidates comparing XK0-005 exam dumps, ExamTopics and other XK0-005 practice tests use this page for the answers and explanations behind each question. Download the free XK0-005 PDF, then sit the timed XK0-005 exam simulation before booking with CompTIA.
Last updated: October 4, 2026
- Exam code
- XK0-005
- Provider
- CompTIA
- Questions in our bank
- 1000+
- Free to read
- First 10, with answers
- Official page
- Official Exam website
- Our test mode duration & pass mark
- 130 mins · 70%
Recommended: Switch to Test Mode to start a practice test that simulates the real exam experience.
Question #1
A Linux administrator intends to start using KVM on a Linux server. Which of the following commands will allow the administrator to load the KVM module as well as any related dependencies?
Correct answer: A
Explanation
This command will load the KVM module as well as any related dependencies, such as kvm-intel or kvm-amd, depending on the processor type. The modprobe command is a Linux utility that reads the /etc/modules.conf file and adds or removes modules from the kernel. It also resolves any dependencies between modules, so that they are loaded in the correct order. The other options are incorrect because: * B. insmod kvm This command will only load the KVM module, but not any related dependencies. The insmod command is a low-level Linux utility that inserts a single module into the kernel. It does not resolve any dependencies between modules, so they have to be loaded manually. * C. depmod kvm This command will not load the KVM module at all, but only create a list of module dependencies for modprobe to use. The depmod command is a Linux utility that scans the installed modules and generates a file called modules.dep that contains dependency information for each module. * D. hotplug kvm This command is invalid and does not exist. The hotplug mechanism is a feature of the Linux kernel that allows devices to be added or removed while the system is running. It does not have anything to do with loading modules.
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #2
A systems administrator wants to back up the directory /data and all its contents to /backup/data on a remote server named remote. Which of the following commands will achieve the desired effect?
Correct answer: C
Explanation
The command that will back up the directory /data and all its contents to /backup/data on a remote server named remote is rsync -a /data remote:/backup/. This command uses the rsync tool, which is a remote and local file synchronization tool. It uses an algorithm to minimize the amount of data copied by only moving the portions of files that have changed. The -a option stands for archive mode, which preserves the permissions, ownership, timestamps, and symbolic links of the files. The /data argument specifies the source directory to be backed up, and the remote:/backup/ argument specifies the destination directory on the remote server. The rsync tool will create a subdirectory named data under /backup/ on the remote server, and copy all the files and subdirectories from /data on the local server. The other options are not correct commands for backing up a directory to a remote server. The scp -p /data remote:/backup/data command will copy the /data directory as a file named data under /backup/ on the remote server, not as a subdirectory with its contents. The -p option preserves the permissions and timestamps of the file, but not the ownership or symbolic links. The ssh -i /remote:/backup/ /data command will try to use /remote:/backup/ as an identity file for SSH authentication, which is not valid. The cp -r /data /remote/backup/ command will try to copy the /data directory to a local directory named /remote/backup/, not to a remote server. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Automating Tasks; rsync(1) - Linux manual page
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #3
The administrator comptia is not able to perform privileged functions on a newly deployed system. Given the following command outputs: Which of the following is the reason that the administrator is unable to perform the assigned duties?

Correct answer: B
Explanation
The reason that the administrator is unable to perform the assigned duties is because the administrator is not a part of the correct group. This is option B. Based on the image that you sent, I can see that the user comptia has a user ID and a group ID of 1000, and belongs to only one group, which is also comptia. However, the sudoers file, which defines the permissions for users to run commands as root or other users, does not include the comptia group in any of the entries. Therefore, the user comptia cannot use sudo to perform privileged functions on the system. The other options are incorrect because: * A. The administrator needs a password reset. This is not true, because the password aging information for the user comptia shows that the password was last changed on Oct 24, 2023, and it does not expire until Jan 22, 2024. There is no indication that the password is locked or expired. * C. The administrator did not update the sudo database. This is not necessary, because the sudo database is automatically updated whenever the sudoers file is modified. There is no separate command to update the sudo database. * D. The administrator’s credentials need to be more complex. This is not relevant, because the complexity of the credentials does not affect the ability to use sudo. The sudoers file does not specify any password policy for the users or groups that are allowed to use sudo.
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #4
The application team has reported latency issues that are causing the application to crash on the Linux server. The Linux administrator starts troubleshooting and receives the following output: Which of the following commands will improve the latency issue?

Correct answer: D
Explanation
The best command to use to improve the latency issue is D. # echo ‘net.core.rmem max = 12500000’ >> /etc/sysctl.conf # echo ‘net.core.wmem_max = 12500000’ >> /etc/sysctl.conf # sysctl -p. This command will increase the size of the receive and send buffers for the network interface, which can improve the network performance and reduce packet loss. The sysctl command will apply the changes to the kernel parameters without rebooting the system. The other commands are either incorrect or not suitable for this task. For example: • A. # echo ‘net.core.net_backlog = 5000000’ >> /etc/sysctl.conf # sysctl -p # systemctl daemon-reload will try to increase the backlog queue for incoming connections, but this is not relevant for the latency issue. The systemctl daemon- reload command is also unnecessary, as it only reloads the systemd configuration files, not the kernel parameters. • B. # ifdown eth0 # ip link set dev eth0 mtu 800 # ifup eth0 will try to change the maximum transmission unit (MTU) of the network interface to 800 bytes, but this is too low and may cause fragmentation and performance degradation. The default MTU for Ethernet is 1500 bytes, and it should not be changed unless there is a specific reason. • C. # systemctl stop network # ethtool -g eth0 512 # systemctl start network will try to change the ring buffer size of the network interface to 512, but this is too small and may cause packet drops and latency spikes. The default ring buffer size for Ethernet is usually 4096 or higher, and it should be increased if there is a high network traffic.
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #5
A Linux administrator is troubleshooting a memory-related issue. Based on the output of the commands: Which of the following commands would address the issue?

Correct answer: B
Explanation
The command that would address the memory-related issue is kill -9 8321. This command will send a SIGKILL signal to the process with the PID 8321, which is the mysqld process that is using 99.7% of the available memory according to the top output. The SIGKILL signal will terminate the process immediately and free up the memory it was using. However, this command should be used with caution as it may cause data loss or corruption if the process was performing some critical operations. The other options are not correct commands for addressing the memory-related issue. The top -p 8321 command will only display information about the process with the PID 8321, but will not kill it or reduce its memory usage. The renice -10 8321 command will change the priority (niceness) of the process with the PID 8321 to -10, which means it will have a higher scheduling priority, but this will not affect its memory consumption. The free 8321 command is invalid because free does not take a PID as an argument; free only displays information about the total, used, and free memory in the system. References: How to troubleshoot Linux server memory issues; kill(1) - Linux manual page
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #6
A cloud engineer is installing packages during VM provisioning. Which of the following should the engineer use to accomplish this task?
Correct answer: A
Explanation
The cloud engineer should use cloud-init to install packages during VM provisioning. Cloud-init is a tool that allows the customization of cloud instances at boot time. Cloud-init can perform various tasks, such as setting the hostname, creating users, installing packages, configuring network, and running scripts. Cloud-init can work with different cloud platforms and Linux distributions. This is the correct tool to accomplish the task. The other options are incorrect because they are either not suitable for cloud provisioning (Bash or Docker) or not a tool but a design pattern (Sidecar). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 563.
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #7
To harden one of the servers, an administrator needs to remove the possibility of remote administrative login via the SSH service. Which of the following should the administrator do?
Correct answer: B
Explanation
The administrator should set PermitRootLogin to no in the /etc/ssh/sshd_config file to remove the possibility of remote administrative login via the SSH service. The PermitRootLogin directive controls whether the root user can log in using SSH. Setting it to no will deny any remote login attempts by the root user. This will harden the server and prevent unauthorized access. The administrator should also restart the sshd service after making the change. The other options are incorrect because they either do not affect the SSH service (/etc/hosts.deny or /etc/pam.d/sshd) or do not prevent remote administrative login (PubKeyAuthentication). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, page 413.
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #8
A user generated a pair of private-public keys on a workstation. Which of the following commands will allow the user to upload the public key to a remote server and enable passwordless login?
Correct answer: D
Explanation
The command ssh-copy-id user@server will allow the user to upload the public key to a remote server and enable passwordless login. The ssh-copy-id command is a tool for copying the public key to a remote server and appending it to the authorized_keys file, which is used for public key authentication. The command will also set the appropriate permissions on the remote server to ensure the security of the key. The command ssh-copy-id user@server will copy the public key of the user to the server and allow the user to log in without a password. This is the correct command to use for this task. The other options are incorrect because they either do not copy the public key (scp, rsync, or ssh-add) or do not use the correct syntax (scp ~/.ssh/id_rsa user@server:~/ instead of scp ~/.ssh/id_rsa.pub user@server:~/ or rsync ~ /.ssh/ user@server:~/ instead of rsync ~/.ssh/id_rsa.pub user@server:~/). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, page 410.
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #9
Users are reporting that writes on a system configured with SSD drives have been taking longer than expected, but reads do not seem to be affected. A Linux systems administrator is investigating this issue and working on a solution. Which of the following should the administrator do to help solve the issue?
Correct answer: A
Explanation
TRIM is a feature that allows the operating system to inform the SSD which blocks of data are no longer in use and can be wiped internally. This helps to maintain the SSD’s performance and endurance by preventing unnecessary write operations and reducing write amplification12. Running the corresponding command to trim the SSD drives, such as fstrim or blkdiscard on Linux, can help to solve the issue of slow writes by freeing up space and optimizing the SSD’s internal garbage collection34. References: 1: What is SSD TRIM, why is it useful, and how to check whether it is turned on 2: How to Trim SSD in Windows 10 3: How to run fsck on an external drive with OS X? 4: How to Use the fsck Command on Linux
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Question #10
A systems administrator wants to be sure the sudo rules just added to /etc/sudoers are valid. Which of the following commands can be used for this task?
Correct answer: A
Explanation
The command visudo -c can be used to check the validity of the sudo rules in the /etc/sudoers file. The visudo command is a tool for editing and validating the /etc/sudoers file, which defines the rules for the sudo command. The -c option checks the syntax and logic of the file and reports any errors or warnings. The command visudo - c will verify the sudo rules and help the administrator avoid any mistakes. This is the correct command to use for this task. The other options are incorrect because they either do not check the validity of the file (test, sudo, or cat) or do not exist (sudo vi check). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 546.
Continue with XK0-005: CompTIA Linux
Unlock the full question bank
You have read the first 10 questions. A subscription opens every question in XK0-005: CompTIA Linux, the full timed practice test, and your progress and weak-topic reporting.
Single exam
$19.99for 30 days
Full question bank and practice test for one exam, for 30 days.
Single exam
$49.99for 1 year
One exam for a full year. Nothing renews and nothing to cancel.
Full access
$39.99/mo
Every exam in the catalogue, month to month.
Full access
$199.99/yr
Every exam in the catalogue for a year.
Already subscribed? Sign in to pick up where you left off.
Discussion
Explain your reasoning, not just the letterOther CompTIA certifications
- SK0-004: CompTIA Server (opens in a new tab)
- SY0-701: CompTIA Security 2023 (opens in a new tab)
- N10-008: CompTIA Network (opens in a new tab)
- CS0-002: CompTIA CySA Certification Exam (CS0-002) (opens in a new tab)
- SY0-601: CompTIA Security 2021 (opens in a new tab)
- N10-009: CompTIA Network+ Exam (opens in a new tab)
- N10-007: CompTIA Network 2018 (opens in a new tab)
- CS0-003: CompTIA CySA (CS0-003) (opens in a new tab)
- 220-1102: CompTIA A Certification Exam: Core 2 (opens in a new tab)
- SK0-005: CompTIA Server Certification Exam (opens in a new tab)
- 220-1101: CompTIA A Certification Exam: Core 1 (opens in a new tab)
- CS0-001: CompTIA CySA Certification Exam (opens in a new tab)
Reviews
Write a review★★★★★
Exam Practice is worth every penny. The mock exams are realistic, and the feedback helped me focus on key areas.
Amit SharmaVerified buyer
★★★★★
I highly recommend Exam Practice. The feedback after each test helped me improve significantly, and I passed my exams easily.
Oscar NyströmVerified buyer
★★★★★
This platform is a lifesaver. The practice questions and explanations are so detailed. It’s the best study tool I’ve ever used.
Hannah SmithVerified buyer
FAQ
Learn More: https://www.comptia.org/certifications
- Q1: Is the CompTIA Linux+ XK0-005 exam still available?
- A: No. The English version of XK0-005 retired on 13 January 2026 and the Japanese, Portuguese and Spanish versions retired on 14 April 2026. It was replaced by Linux+ XK0-006, which launched on 15 July 2025.
- Q2: How many questions were on the XK0-005 exam and how long was it?
- A: The real exam had a maximum of 90 multiple-choice and performance-based questions and a 90-minute time limit.
- Q3: What was the passing score for Linux+ XK0-005?
- A: A score of 720 on a scale of 100 to 900 was required to pass.
- Q4: What domains did XK0-005 cover and how were they weighted?
- A: The exam had four domains: System Management 32%, Security 21%, Scripting, Containers and Automation 19%, and Troubleshooting 28%.
- Q5: How much did the XK0-005 exam cost?
- A: CompTIA's published US price was US$369 per exam as of February 2024.
- Q6: What experience was recommended before taking XK0-005?
- A: CompTIA recommended 12 months of hands-on experience working with Linux servers, plus CompTIA A+, Network+ and Server+ or equivalent knowledge. There were no mandatory prerequisites.
- Q7: In which languages was XK0-005 offered and how was it delivered?
- A: The exam launched on 12 July 2022 and was offered in English, Japanese, Portuguese and Spanish at Pearson VUE test centers or through online testing.
- Q8: How does the newer XK0-006 exam differ from XK0-005?
- A: XK0-006 keeps the 90-question, 90-minute format and the 720 passing score but is offered in English only and uses five domains: System Management 23%, Services and User Management 20%, Security 18%, Automation, Orchestration and Scripting 17%, and Troubleshooting 22%.
- Q9: What is the XK0-005: CompTIA Linux exam?
- A: XK0-005: CompTIA Linux is a CompTIA certification exam. Judging by the questions in our bank, it concentrates on commands, linux, accomplish, script and directory.
- Q10: What topics does the XK0-005: CompTIA Linux exam cover?
- A: Questions in our XK0-005: CompTIA Linux bank cluster around commands, linux, accomplish, script, directory, repository, forwarder and engineer. Working through the full set is the quickest way to find which of these you are weakest on.
- Q11: How should I prepare for XK0-005: CompTIA Linux?
- A: Work through the XK0-005: CompTIA Linux practice questions here, checking your answer on each one, then sit the practice test to rehearse the exam under timed conditions before the real thing.
- Q12: Are these real XK0-005: CompTIA Linux exam questions?
- A: They are drawn from officially released past questions and from community members who have sat XK0-005: CompTIA Linux. Answers are verified and updated weekly.
- Q13: Where do I register for the XK0-005: CompTIA Linux exam?
- A: Register through CompTIA directly at https://www.comptia.org/certifications. Exampractice is not affiliated with CompTIA and does not administer the exam.
- Q14: Is there a free XK0-005: CompTIA Linux sample?
- A: Yes. Every XK0-005: CompTIA Linux page shows a free sample of real questions. Upgrading opens the full bank and the practice test.
- Q15: What are CompTIA Certification Exams?
- A: CompTIA Certification Exams validate your expertise in various IT disciplines, including networking, security, cloud computing, and IT support. These certifications demonstrate your proficiency in applying best practices and industry standards to manage and troubleshoot IT environments.
- Q16: Why should I pursue CompTIA Certification?
- A: CompTIA Certification enhances your professional credibility, showcasing your skills and knowledge in essential IT areas. This can lead to better job opportunities, higher salaries, and career advancement in IT support, networking, cybersecurity, and cloud computing fields.
- Q17: What are the benefits of CompTIA Certification?
- A: Benefits include recognition as a certified IT professional, improved job performance, access to exclusive resources, continuing education opportunities, and staying current with the latest IT industry trends and best practices.
- Q18: Who should take CompTIA Certification Exams?
- A: IT professionals, network administrators, cybersecurity experts, cloud engineers, and anyone involved in managing and supporting IT infrastructure should consider these certifications to validate their expertise and advance their careers.
- Q19: What types of CompTIA Certification Exams are available?
- A: CompTIA offers various certification paths, including:
- Q20: How do I prepare for CompTIA Certification Exams?
- A: Preparation can include official CompTIA training courses, study guides, practice exams, online tutorials, and hands-on experience in relevant IT disciplines.
- Q21: Where can I take CompTIA Certification Exams?
- A: CompTIA Certification Exams can be taken at authorized Pearson VUE testing centers worldwide or online, providing flexibility to fit your schedule and location.
- Q22: How do CompTIA Certifications impact my career?
- A: CompTIA Certifications significantly boost your career by demonstrating your expertise to employers, making you a more competitive candidate for advanced roles and promotions in IT support, networking, cybersecurity, and cloud computing.
- Q23: Are there any prerequisites for CompTIA Certification Exams?
- A: Some exams may have prerequisites, such as foundational knowledge or prior certifications. Check the specific requirements for each certification path on the CompTIA website.
- Q24: How often do I need to recertify for CompTIA Certifications?
- A: CompTIA Certifications typically require recertification every three years to ensure that certified professionals stay updated with the latest IT technologies and industry practices.



