00:15: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
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 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.

Free CompTIA Linux+ XK0-005 Practice Test

Press start when you are ready, or press Change to modify any settings for the practice test.

  • Questions: 15
  • Time: Unlimited
  • Included Topics:
    System Management
    Security
    Scripting, Containers, and Automation
    Troubleshooting
Question 1 of 15

A system administrator has been tasked with writing a shell script that reads a list of usernames from a text file named 'users.txt' and then checks whether each user exists on the system. The admin decides to use a loop along with a built-in command to verify this. Which command should be used within the loop to check the presence of a user account in the system environment?

  • You selected this option

    whoami

  • You selected this option

    pwd

  • You selected this option

    hostname

  • You selected this option

    id

  • You selected this option

    date

Question 2 of 15

A system administrator needs to check the maximum amount of RAM supported by the server's motherboard. Which command would provide this information?

  • You selected this option

    lsblk

  • You selected this option

    dmidecode --type memory

  • You selected this option

    dmidecode -s system-product-name

  • You selected this option

    lscpu

Question 3 of 15

The command 'at' can be used to schedule a job for a specific time without the requirement for that to recur at regular intervals.

  • You selected this option

    The statement is accurate

  • You selected this option

    The statement is inaccurate

Question 4 of 15

The security policy of your company requires a stealthy scan to minimize the chances of detection by the target system's intrusion detection system (IDS). Which Nmap command would perform a SYN scan, while also spoofing the source port to appear as 53 (DNS) and avoiding port 22 on the target 10.0.0.12?

  • You selected this option

    nmap -sS -g 53 --exclude-ports 22 10.0.0.12

  • You selected this option

    nmap -sT --spoof-port 53 -p-22 10.0.0.12

  • You selected this option

    nmap -sS -D RND:10 -g 53 10.0.0.12

  • You selected this option

    nmap -sS --source-port 53 --excludefile no-scan-22.txt 10.0.0.12

  • You selected this option

    nmap -sU -g 53 -p !22 10.0.0.12

  • You selected this option

    nmap -sS -Pn -g 53 --skip-port 22 10.0.0.12

Question 5 of 15

A Linux administrator needs to grant a user named 'jane' write access to a file called 'data.log', which is currently only accessible by its owner 'john'. The file should not have its existing permissions altered for any other user or group. Which of the following commands would correctly grant 'jane' the required access?

  • You selected this option

    setfacl -m u:jane:rwx data.log

  • You selected this option

    setfacl -m u:jane:w data.log

  • You selected this option

    chmod u+w data.log

  • You selected this option

    chmod +w data.log

  • You selected this option

    chown jane data.log

  • You selected this option

    setfacl -m o:w data.log

Question 6 of 15

What operation should be periodically performed on a solid-state storage device to indicate which sectors are no longer in use?

  • You selected this option

    Performing a surface scan

  • You selected this option

    Running a defragmentation program

  • You selected this option

    Executing a trim command

  • You selected this option

    Increasing the partition size

  • You selected this option

    Conducting a sector-by-sector backup

Question 7 of 15

As a system administrator, you have received a file named 'logins.txt' containing a list of usernames. However, the usernames are separated by commas and you need them to be separated by newlines to process them in a script. Using the 'tr' command, how would you translate the commas into newline characters in a shell script?

  • You selected this option

    tr ',' '\n' < logins.txt

  • You selected this option

    tr -s ',' '\n' logins.txt

  • You selected this option

    tr '\n' ',' < logins.txt

  • You selected this option

    tr -d ',' '\n' logins.txt

Question 8 of 15

What is the primary function of the 'resolvectl' command in a Linux system?

  • You selected this option

    Manage DNS resolution on the system

  • You selected this option

    Enable or disable network interfaces

  • You selected this option

    Establish a VPN connection

  • You selected this option

    Monitor network traffic in real time

Question 9 of 15

A system administrator needs to monitor resource usage and performance in real time to identify a process that is consuming an unusually high percentage of CPU resources. Which of the following commands provides the BEST solution for this requirement?

  • You selected this option

    cat /proc/cpuinfo

  • You selected this option

    pscat

  • You selected this option

    ps aux --sort -%cpu

  • You selected this option

    top

Question 10 of 15

Which command would you use to download a file from the internet using the command line while ensuring that the output is saved with a specific filename?

Question 11 of 15

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?

  • You selected this option

    chronyc sources

  • You selected this option

    chronyc add server

  • You selected this option

    chronyc tracking

  • You selected this option

    chronyc sourcestats

Question 12 of 15

An administrator notices that a recently mounted ext4 filesystem is not correctly recording the access times of files when they are read. The administrator suspects that a mount option may be causing this behavior. Which of the following mount options did the administrator most likely use when mounting the filesystem?

  • You selected this option

    noatime

  • You selected this option

    dirsync

  • You selected this option

    sync

  • You selected this option

    relatime

Question 13 of 15

The command make install is used before the command ./configure when compiling a package from source.

  • You selected this option

    True

  • You selected this option

    False

Question 14 of 15

As a system administrator, you need to remove a user's account from a Linux system. The user's account, 'johndoe', must be deleted along with the user's home directory and mail spool. Which command should you use to accomplish this task?

  • You selected this option

    removeuser --files johndoe

  • You selected this option

    userdel -r johndoe

  • You selected this option

    deluser johndoe

  • You selected this option

    userdel johndoe

Question 15 of 15

As a systems administrator, you need to grant a user named 'techuser' the ability to run all commands as any user on a specific Linux server. To accomplish this, you decide to edit the sudoers file. Which of the following entries should you add to the sudoers file using the 'visudo' command to meet this requirement?

  • You selected this option

    techuser ALL=(ALL:ALL) ALL

  • You selected this option

    ALL techuser=(ALL:ALL) ALL

  • You selected this option

    techuser ALL=(ALL) ALL

  • You selected this option

    techuser ANY=(ALL:ALL) NOPASSWD: ALL