00:20:00

CompTIA Linux+ Practice Test (XK0-005)

Use the form below to configure your CompTIA Linux+ Practice Test (XK0-005). The practice test can be configured to only include certain exam objectives and domains. You can choose between 5-100 questions and set a time limit.

Logo for CompTIA Linux+ XK0-005 (v7)
Questions
Number of questions in the practice test
Free users are limited to 20 questions, upgrade to unlimited
Seconds Per Question
Determines how long you have to finish the practice test
Exam Objectives
Which exam objectives should be included in the practice test

CompTIA Linux+ XK0-005 (v7) Information

CompTIA Linux+ (XK0-005) Exam

The CompTIA Linux+ (XK0-005) certification is designed for IT professionals who work with Linux systems. It validates skills in system administration, security, scripting, and troubleshooting. This certification is vendor-neutral, covering multiple distributions such as Ubuntu, CentOS, and Red Hat.

Exam Overview

The XK0-005 exam consists of a maximum of 90 questions, including multiple-choice and performance-based questions. Candidates have 90 minutes to complete the test. The exam costs $358 USD. A passing score is 720 on a scale of 100 to 900. The certification is valid for three years and can be renewed through CompTIA’s continuing education program.

Exam Content

The XK0-005 exam focuses on five main domains: system management, security, scripting and automation, troubleshooting, and Linux fundamentals. System management includes package management, system monitoring, and user administration. Security covers permissions, authentication, and encryption. Scripting and automation focus on Bash scripting and task automation. Troubleshooting tests problem-solving skills for system failures and performance issues. Linux fundamentals include file system hierarchy, networking, and command-line operations.

Who Should Take This Exam?

The CompTIA Linux+ certification is ideal for system administrators, Linux support technicians, and DevOps professionals. It is recommended for individuals with at least one year of Linux experience. This certification is beneficial for IT professionals working with servers, cloud infrastructure, and cybersecurity.

How to Prepare

Candidates should review the official CompTIA Linux+ Exam Objectives and study materials provided by CompTIA. Hands-on experience with Linux systems is essential. Practice exams can help assess readiness and identify weak areas. Using Linux in a lab or virtual environment can provide practical experience with commands, system configuration, and troubleshooting.

Summary

The CompTIA Linux+ (XK0-005) certification is a valuable credential for IT professionals working with Linux systems. It validates essential skills in system administration, security, and automation. This certification is ideal for those managing Linux-based environments in IT infrastructure, cybersecurity, and cloud computing.

CompTIA Linux+ XK0-005 (v7) Logo
  • Free CompTIA Linux+ XK0-005 (v7) Practice Test

  • 20 Questions
  • Unlimited
  • System Management
    Security
    Scripting, Containers, and Automation
    Troubleshooting
Question 1 of 20

A system administrator has noticed that over time, a Linux server's available memory decreases, even when the workload on the server remains consistent. The 'top' command shows a particular process gradually increasing its memory usage without releasing it back to the system. Which of the following tools should the administrator use to further investigate this suspected memory leak in the problematic process?

  • mpstat

  • vmstat

  • free

  • valgrind

Question 2 of 20

An administrator has just completed the installation of a new kernel on a Linux system. After installing the kernel and related modules, they wish to update the GRUB2 bootloader configuration to ensure that the system will boot using this new kernel. Which of the following commands should the administrator run to correctly generate a new configuration and ensure the new kernel is bootable?

  • grub2-mkconfig -o /boot/grub2/grub.cfg

  • grub2-install

  • mkinitrd /boot/initrd.img

  • grub2-update

Question 3 of 20

A system administrator is tasked with restricting access to a web server running on the default HTTP port to only the IP range 192.168.100.0/24. The server is currently using firewalld for its firewall management. Which of the following commands should the administrator use to accomplish this task?

  • firewall-cmd --permanent --zone=public --add-source=192.168.100.256/24

  • firewall-cmd --permanent --zone=public --add-rich-rule='rule family="ipv4" source address="192.168.100.0/24" port protocol="tcp" port="80" accept'

  • firewall-cmd --permanent --zone=public --add-service=http --source=192.168.100.0/24

  • firewall-cmd --permanent --new-zone=192.168.100.0/24

Question 4 of 20

An administrator needs to extend the storage capacity of a Linux server. They have added a new physical disk and created a physical volume (PV) on it. Now, the administrator wants to check the existing volume groups (VGs) to decide into which volume group the new physical volume should be extended. Which command should be used to display the current volume groups and their associated information?

  • fdisk -l

  • lvdisplay

  • vgs

  • pvscan

Question 5 of 20

A Linux system administrator is managing a web server and discovers that CGI scripts in /var/www/cgi-bin are being blocked by SELinux. An audit of /var/log/audit/audit.log confirms the denials. The administrator needs to enable CGI script execution permanently, ensuring the change persists across reboots and is the standard method for this adjustment. Which command should the administrator use?

  • audit2allow -a -M local_httpd_cgi && semodule -i local_httpd_cgi.pp

  • setsebool -P httpd_enable_cgi on

  • setenforce 0

  • chcon -R -t httpd_sys_script_exec_t /var/www/cgi-bin

Question 6 of 20

A system administrator is writing a shell script that reads usernames from a file named users.txt and needs to verify whether each account exists on the local system. Which command is the most suitable to place inside the loop to test if a specified user account is present?

  • pwd

  • id

  • whoami

  • hostname

Question 7 of 20

A system administrator suspects that a newly installed network card is not being recognized by the Linux kernel. Which command should be used to verify if the card is detected by the system at the hardware level?

  • lsusb

  • lspci

  • lsmod

  • dmesg | grep -i network

Question 8 of 20

In an effort to secure communication for an internal-facing web service, a system administrator has been tasked with implementing an encrypted connection protocol. External validation of the server's identity by outside entities is not a requirement due to the service being exclusively accessed within the organization. What is the most appropriate action for the administrator to undertake?

  • Create and configure a certificate signed by the server's private key.

  • Rely on secure shell protocols for encrypted web traffic, circumventing the need for certificates.

  • Obtain and install a certificate from a recognized certificate authority.

  • Operate the web service without encryption since it is internally accessed and does not need protection.

Question 9 of 20

A script named process_users.sh expects entries from standard input. Which command sends the contents of users.csv into the script’s input so it processes each line?

  • ./process_users.sh >> users.csv

  • ./process_users.sh < users.csv

  • ./process_users.sh users.csv

  • ./process_users.sh << users.csv

Question 10 of 20

A system administrator is troubleshooting an application that is reported to be leaking resources. Upon running ps aux, the administrator observes several child processes of the application are marked with a 'Z' in the STAT column. Although these processes have completed their tasks, they remain in the process table. What is the state of these processes?

  • Stopped

  • Running

  • Sleeping

  • Zombie

Question 11 of 20

Which command will permanently mount a filesystem at boot by adding an entry to a specific configuration file?

  • Execute systemctl enable mount

  • Use fstab --add-entry

  • Use mount --permanent

  • Edit /etc/fstab

Question 12 of 20

An organization requires a data storage solution using multiple disks. The solution must ensure continuous data availability even if two disks fail concurrently. Which configuration should be utilized to fulfill this requirement?

  • A striped set with dual distributed parity

  • A striped set of mirrored pairs

  • A striped set without parity or redundancy

  • A striped set using single distributed parity

Question 13 of 20

A system administrator is deploying a multi-container application on a single Docker host. The application includes a web server container that needs to communicate with a database container. Both containers should be isolated from other network traffic on the Docker host. Which Docker network driver should the administrator use to fulfill these requirements?

  • Default bridge

  • Bridge

  • Host

  • Overlay

Question 14 of 20

A development team wants to automate their workflow. Their goal is to have every git push to the main branch automatically trigger a process that builds the application, runs a full suite of integration tests, and then deploys the application to a staging server for review. Which of the following approaches BEST satisfies all requirements of this scenario?

  • Setting up a Jenkins pipeline

  • Configuring a post-receive Git hook to run deployment scripts

  • Using a cron job to periodically pull and deploy changes

  • Automating the workflow using a set of independent shell scripts

Question 15 of 20

A developer is working on a feature branch called new-feature. Another team member has just updated the remote main branch with critical security fixes. The developer needs to update their new-feature branch with these changes from the remote main branch to ensure their code is compatible. Which single Git command will fetch the remote changes and merge them into the developer's current new-feature branch?

  • git merge main

  • git pull origin main

  • git push origin main

  • git fetch origin main

Question 16 of 20

An administrator needs to download the latest version of an Ubuntu image for container deployment. Which of the following commands will perform this operation?

  • pull ubuntu

  • docker pull ubuntu

  • docker push ubuntu

  • docker rmi ubuntu

Question 17 of 20

An administrator must allow external collaborators to reach an internal HTTP host on port 80 by connecting to a bastion server. The bastion should accept connections on port 8080 and forward them to the internal host. Which SSH option enables this setup on the bastion server?

  • -D 8080

  • -L 8080:internal.host:80

  • -R 8080:internal.host:80

  • -N

Question 18 of 20

A Linux server cannot establish connections to devices located on another segment of the network. Upon inspection, you discover that the server has been assigned an address of 192.168.1.110 with a mask indicating its subnet can host up to 126 devices. A noted detail is that the segment's gateway resides at 192.168.1.129. What is the BEST explanation for this connectivity issue?

  • The subnet does not provide an adequate number of host addresses for the network's needs

  • The gateway's address falls outside the server's subnet range

  • The server is assigned the network address of the subnet

  • The server is utilizing the address typically reserved for broadcasting within its subnet

Question 19 of 20

A Linux administrator is deploying an application on Kubernetes and needs to ensure that two containers (a web server and a caching service) share the same network and storage resources. Which of the following is the BEST option to achieve this requirement?

  • Create a new Kubernetes service to facilitate communication between two standalone pods

  • Use a DaemonSet to ensure that both containers run on each node in the cluster

  • Deploy both containers within a single pod

  • Launch separate pods for each container and use a service to link them

Question 20 of 20

An administrator examines the line below from /etc/shadow for user alice: alice:$6$Xh3...:18570:0:99999:7::: What does the “7” represent in this record?

  • Number of days users receive notices before their credential’s validity ends

  • Minimal interval in days users must wait between credential updates

  • Duration in days after expiry until the account is disabled

  • Maximum span in days a credential remains valid before a change is required