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

Free Preview

This test is a free preview, no account required.
Subscribe to unlock all content, keep track of your scores, and access AI features!

Question 1 of 20

A Linux administrator is compiling a software package from its source code. Which of the following command sequences is the standard and correct order for this process?

  • make make install ./configure

  • make install ./configure make

  • ./configure make make install

  • ./configure make install make

Question 2 of 20

In the process of deploying a new virtual machine that hosts an Apache web server, a Linux administrator has opened port 80 on the server's firewall and added the host record to DNS. From a workstation on a different subnet, the administrator now needs to verify two things: (1) that the web daemon is actually bound to TCP port 80 on the new server, and (2) that the port can be reached end-to-end across the network. The administrator prefers to perform both checks with a single command-line tool that requires no configuration changes on the remote host. Which command should be used?

  • netstat -tuln | grep ':80'

  • openssl s_client -connect remote_server_ip:80

  • dig remote_server_ip -p 80

  • nmap -p 80 remote_server_ip

Question 3 of 20

When configuring a systemd service unit file, which Type setting will only consider the service started after the process finishes initializing and explicitly signals that it is ready to accept connections or tasks?

  • forking

  • simple

  • dbus

  • notify

Question 4 of 20

A system administrator is provisioning a new server and creating user accounts for the development team. One of the new developers, 'mchavez', will need a dedicated space to store source code, personal scripts, and user-specific application configuration files. According to the Filesystem Hierarchy Standard (FHS), which of the following directories should be the default location for this user's data?

  • /boot

  • /tmp

  • /etc

  • /home

Question 5 of 20

You are logged in to a Linux server running Docker Engine 24.x. To obtain a concise table showing only the containers that are currently running-excluding any that are stopped-using the original shorthand form of the Docker CLI, which single command should you run?

  • docker container ls -a

  • docker ps -a

  • docker inspect $(docker ps -q)

  • docker ps

Question 6 of 20

A directory at /data/shared currently has permissions set to 0777, allowing all users full access. You need to keep read, write, and execute rights for everyone but ensure that only file owners can remove or rename their own files. Which command achieves this goal?

  • chmod 0777 /data/shared

  • chmod 6777 /data/shared

  • chmod 1777 /data/shared

  • chmod 2777 /data/shared

Question 7 of 20

A script needs to create a temporary file in the directory from which it is executed. The script will be called by users from various locations, so hardcoding an absolute path is not feasible. To ensure the script can reliably determine its current working directory, which of the following lines would correctly assign the absolute path of the current directory to the EXEC_DIR variable?

  • EXEC_DIR=$(dirname $0)

  • EXEC_DIR=$(pwd)

  • EXEC_DIR=$(which $0)

  • EXEC_DIR=$CWD

Question 8 of 20

A systems administrator needs to download a critical security patch from a vendor's website. The download link is http://vendor.com/downloads/patch.cgi?id=9a4f2, which saves the file with a non-descriptive name. To maintain clarity in the local /tmp/patches directory, the administrator wants to save the file as vendor_patch_2025-10-07.tar.gz directly during the download. Which of the following commands will achieve this?

Question 9 of 20

A system administrator needs to ensure that a recently installed kernel appears in the boot menu. The GRUB2 bootloader is used, and the administrator has copied the new kernel image to /boot. Which of the following commands should be executed to regenerate the GRUB2 configuration so that the new kernel will be listed at boot time?

  • update-grub

  • mkinitrd

  • grub2-mkconfig --refresh

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

Question 10 of 20

What would be the result of the following command: echo 'The quick brown fox' | sed 's/quick/slow/'?

  • Theslowbrownfox

  • The quick brown fox

  • The quick slow brown fox

  • The slow brown fox

Question 11 of 20

A system administrator is writing a shell script that periodically checks the disk space usage on a Linux server. To ensure that the output of the disk check does not flood the terminal or logs when running the script via a cron job, the administrator wants to discard the standard output. Which command redirection to /dev/null achieves this purpose?

  • df -h &> /dev/null

  • df -h > /dev/null

  • df -h 2> /dev/null

  • df -h | /dev/null

Question 12 of 20

An administrator needs to enable a fellow technician to access a remote Linux server for system management. Which of the following configurations will BEST ensure that the technician can connect securely without password authentication?

  • Provide the technician with the server password to use with SSH.

  • Modify the ~/.ssh/config file on the technician's machine to include the server's information.

  • Use ssh-keygen to create a key pair and ssh-copy-id to copy the public key to the server.

  • Instruct the technician to use ssh-add followed by the server's IP to access the server.

Question 13 of 20

A systems administrator is running a script in the foreground that will take a long time to complete. The administrator needs to check the status of another service but does not want to terminate the script. Which of the following keyboard shortcuts should be used to suspend the script's execution?

  • Ctrl+C

  • Ctrl+Z

  • kill -9 <PID>

  • bg

Question 14 of 20

While containerizing an existing application, a DevOps engineer needs to guarantee that the application container and its accompanying logging sidecar always start, stop, and scale together on the same Kubernetes node, sharing an IP address and storage volumes. Which Kubernetes object should she define to meet this requirement?

  • A Deployment that manages desired replica counts for stateless microservices

  • A Pod that groups the containers and their shared resources

  • A Namespace that isolates resources and access controls within the cluster

  • A Service that exposes the containers on a stable virtual IP

Question 15 of 20

A Linux administrator is preparing to decommission a physical volume that is part of a volume group. Before migrating the data, the administrator must ensure that one of the logical volumes in the group, lv_data, is taken offline to prevent any I/O operations and accidental modifications. Which of the following commands will make the lv_data logical volume in the vg_corp volume group unavailable?

  • lvchange --alloc lock vg_corp/lv_data

  • lvchange -pr vg_corp/lv_data

  • lvchange -an vg_corp/lv_data

  • lvextend --snapshot vg_corp/lv_data

Question 16 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 17 of 20

What is the state of a Linux process that has completed execution but still has an entry in the process table?

  • Sleeping

  • Stopped

  • Zombie

  • Running

Question 18 of 20

A Linux administrator is testing a newly developed kernel module for a proprietary hardware device. The module file, special_pci_driver.ko, is located in a temporary development directory and has not yet been integrated into the system's standard module path or dependency database. The administrator needs to load this single module for an immediate, isolated functionality test, intentionally bypassing any dependency checks or automatic loading of related modules. Which command is designed for this direct and specific purpose?

  • modinfo

  • insmod

  • lsmod

  • modprobe

Question 19 of 20

A system administrator is tasked with setting up several virtual machines to join an existing cloud infrastructure. They need to ensure that each virtual machine is configured automatically upon boot with a specific hostname pattern, user credentials, and custom network configuration without manual intervention. Which technology would be the MOST effective for achieving this goal during the initial boot process?

  • Cloud-init

  • Systemd service units

  • Puppet

  • Ansible

Question 20 of 20

An administrator wants to conduct an aggressive scan to retrieve version information, run default scripts, and to detect the operating system of the target device. Which Nmap command option should be used?

  • -A

  • -p-

  • -o

  • -sn