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

When reviewing file security configurations, a Linux administrator needs to determine if any files in a directory are set with the 'immutable' attribute to prevent alterations. Which command should the administrator use and what flag should they be looking for in the output?

  • Use the lsattr -l command and look for a detailed list of attributes

  • Use the chattr command to check for the 'i' attribute

  • Use the lsattr command and look for files with the 'i' flag

  • Use the lsattr -a command and search for files with the 'a' flag

Question 2 of 20

A freshly installed Linux server under systemd always presents a graphical login prompt, but the operations team requires a console login on each startup. Which command best configures the system so future boots provide the console login?

  • systemctl set-default multi-user.target

  • ln -s /lib/systemd/system/getty.target /etc/systemd/system/default.target

  • systemctl isolate multi-user.target

  • Edit /etc/inittab to specify runlevel 3

Question 3 of 20

After receiving alerts of potential hardware issues, a system administrator needs to check the status of the software RAID arrays on a Linux server. Which is the BEST command to use in order to display the current status of all active RAID arrays managed by mdadm?

  • mdadm --detail

  • lsblk

  • fdisk -l

  • cat /proc/mdstat

Question 4 of 20

A system administrator notices that a production server is experiencing significant slowdowns. Upon further investigation using the top command, it's observed that the I/O wait percentage is consistently above 30%. Considering that the server's disk activity is not excessively high, what could be a probable cause for the high I/O wait?

  • A misconfigured network firewall is limiting incoming connections.

  • The hard drive is failing, causing read/write operations to take longer than usual.

  • The I/O scheduler is configured for a single-threaded process, leading to a bottleneck.

  • Insufficient memory available for buffer/cache leading to frequent disk access.

Question 5 of 20

A system administrator wants to define a PATH update and set a default umask for every user when they log in with a Bourne-compatible shell. Which file should be modified to implement these changes across all existing accounts?

  • /etc/bash.bashrc

  • /etc/environment

  • /etc/profile

  • ~/.bash_profile

Question 6 of 20

A system administrator wants to perform a directory synchronization from a local folder to a remote backup server. The requirement is to ensure that only the differences since the last sync are transferred to minimize network usage. The sync needs to be recursive to include all subdirectories and also preserve file permissions. Which command accomplishes this goal most efficiently?

  • rsync --dry-run /local/directory user@remote:/backup/directory

  • rsync -a /local/directory user@remote:/backup/directory

  • rsync --update /local/directory user@remote:/backup/directory

  • rsync --in-place /local/directory user@remote:/backup/directory

Question 7 of 20

A Linux administrator needs to configure passwordless SSH access for a new developer to a production web server. After the developer generates a new SSH key pair on their workstation, which of the following represents the most secure and efficient method to deploy the public key?

  • Copy the contents of the private key into the ~/.ssh/authorized_keys file on the server.

  • Use scp to copy the public key to the server, then append its contents to the ~/.ssh/authorized_keys file.

  • Edit the /etc/ssh/sshd_config file on the server and add the public key's contents.

  • Run ssh-copy-id user@server from the developer's workstation.

Question 8 of 20

Alice is working on a Linux server and has navigated through several directories. She wants to confirm the absolute path of the directory she is currently working in before deploying a new application. Which command should she use to display her current directory path?

  • pwd

  • cd

  • ls -d .

  • echo $PWD

Question 9 of 20

A Linux administrator must forward all syslog messages via UDP to a remote log server at IP address 192.168.150.50. Which line should be added to /etc/rsyslog.conf (legacy syntax) to meet this requirement?

  • . >192.168.150.50

  • . @192.168.150.50

  • . #192.168.150.50

  • . @@192.168.150.50

Question 10 of 20

A new junior system administrator has been tasked with reviewing user accounts on a vital Linux server. While inspecting the /etc/passwd file, they noticed an account entry that does not have a corresponding /home directory. Which of the following are potential explanations for this situation?

  • The account's default shell is set to /usr/sbin/nologin, which implies that no home directory was created when the account was added.

  • The account is intended for a system service or process and is not designed for regular user login activities.

  • The user associated with the account has been assigned to an incorrect group, which is why the home directory is missing.

  • The account has an expired password and, therefore, the home directory was removed automatically.

Question 11 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?

  • -sn

  • -o

  • -p-

  • -A

Question 12 of 20

A Linux administrator is configuring a system to make sure that any user attempting to access a certain service should present two different forms of identification. Which of the following authentication methods should the administrator configure?

  • Multifactor authentication (MFA)

  • Tokens

  • System Security Services Daemon (SSSD)

  • Pluggable authentication modules (PAM)

Question 13 of 20

A system administrator needs to create a compressed backup of the /var/log directory. Which command should they use to create a gzip-compressed archive file named log_backup.tar.gz?

  • tar -tzvf log_backup.tar.gz /var/log

  • tar -czvf log_backup.tar.gz /var/log

  • tar -xvf log_backup.tar.gz /var/log

  • tar -cvf log_backup.tar.gz /var/log

Question 14 of 20

A system administrator notices that an important server is experiencing intermittent problems with data integrity, and suspects filesystem corruption on one of its disks. After running fsck on the unmounted filesystem and fixing several errors, the administrator needs to ensure that the filesystem will be checked and repaired if necessary during the next system boot. Which of the following commands should the administrator use to schedule a filesystem check on boot?

  • tune2fs -c 1 /dev/sda1

  • tune2fs -i 0 /dev/sda1

  • e2fsck -p /dev/sda1

  • tune2fs -C 0 /dev/sda1

Question 15 of 20

A Linux system administrator notices that a custom service is supposed to start after the local MySQL database server is up and running. However, the custom service sometimes fails because it starts too quickly and does not detect the MySQL service being ready. Which directive should the administrator add to the [Unit] section of the custom service's systemd unit file to ensure it starts after the MySQL service?

  • Wants=mysqld.service

  • BindsTo=mysqld.service

  • After=mysqld.service

  • BindTo=mysqld.service

Question 16 of 20

Which of the following statements about achieving optimal throughput on modern PCIe/NVMe solid-state drives (SSDs) is TRUE?

  • Aligning partitions to 512-byte sector boundaries guarantees maximum SSD throughput regardless of thread count or queue depth.

  • Multi-threaded I/O with an appropriate queue depth can help saturate SSD bandwidth by leveraging the drive's internal parallelism.

  • Single-threaded synchronous I/O always yields the highest possible throughput on any SSD.

  • SSD performance is unaffected by the host's I/O scheduler because the device ignores all queuing decisions.

Question 17 of 20

An administrator is attempting to run a graphical network-configuration utility with elevated privileges on a desktop Linux system that uses PolicyKit. The administrator must ensure that PolicyKit rules are enforced and that any password prompt appears in a graphical dialog. Which command should be used to start the tool?

  • pexec network-configuration-tool

  • sudo network-configuration-tool

  • pkexec network-configuration-tool

  • polkit network-configuration-tool

Question 18 of 20

Which of the following while-loop constructs will create an infinite loop in a POSIX-compliant shell script (assuming no external signals are sent and no files are modified during execution)?

  • while read line; do echo "$line"; done < /etc/passwd

  • while [ -f /tmp/stop ]; do echo "Running"; sleep 1; done

  • while true; do echo "Running"; done

  • while false; do echo "Running"; done

Question 19 of 20

A system administrator has noticed that a server's time is not in sync with its designated time source. They need to verify the current synchronization status and performance of the server's timekeeping. Which command should they use?

  • chronyc add server

  • chronyc sourcestats

  • chronyc tracking

  • chronyc sources

Question 20 of 20

What characteristic distinguishes a stateful firewall from its stateless counterpart in the context of network traffic?

  • Monitors and maintains the state of active connections

  • Operates at a higher performance level

  • Creates dynamic rules for each new connection

  • Filters traffic solely based on static rules