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 systems administrator needs to investigate an issue in a Docker container that is failing to start correctly. The administrator wishes to view the output logs to diagnose the problem. Which command should the administrator run to display the last 50 lines of logs from the container named 'web-app'?

  • You selected this option

    docker inspect --format='{{.LogPath}}' web-app

  • You selected this option

    docker logs -f web-app | tail -50

  • You selected this option

    docker logs --tail 50 web-app

  • You selected this option

    docker container logs web-app --last 50

Question 2 of 15

What command is used in a shell script to perform actions based on whether a particular condition is met or not?

  • You selected this option

    if

  • You selected this option

    while

  • You selected this option

    case

  • You selected this option

    for

Question 3 of 15

In the scenario where a Linux system has multiple services running, which of the following actions is the BEST practice to secure the corresponding service accounts?

  • You selected this option

    Changing the home directory permissions of service accounts to 700.

  • You selected this option

    Setting a strong, unique password for each service account.

  • You selected this option

    Configuring PAM modules to limit the access times for service accounts.

  • You selected this option

    Changing the default shell of the service accounts to /bin/nologin.

Question 4 of 15

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?

  • You selected this option

    Default bridge

  • You selected this option

    Host

  • You selected this option

    Bridge

  • You selected this option

    Overlay

Question 5 of 15

What is the primary function of the groupmod command in a Linux environment?

  • You selected this option

    To modify a group's name or GID (Group ID)

  • You selected this option

    To create a new user account on the system

  • You selected this option

    To add or remove a user from a group

  • You selected this option

    To modify file permissions for a group of files

Question 6 of 15

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?

  • You selected this option

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

  • You selected this option

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

  • You selected this option

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

  • You selected this option

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

Question 7 of 15

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.126 with a mask indicating it 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?

  • You selected this option

    The server is assigned the special address of its subnet that denotes the beginning of the IP range

  • You selected this option

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

  • You selected this option

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

  • You selected this option

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

Question 8 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 -d ',' '\n' logins.txt

  • You selected this option

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

Question 9 of 15

A systems administrator notices a high number of collisions on a Linux-based server's Ethernet interface which is connected to an office's local area network (LAN). The collisions are resulting in noticeable performance degradation. While investigating the cause, what should the administrator check first in order to resolve the issue?

  • You selected this option

    Update the network interface card drivers

  • You selected this option

    Switch port duplex settings

  • You selected this option

    Increase the server's RAM

  • You selected this option

    Router's access control lists

Question 10 of 15

Which lvchange option is used to prevent allocation of physical extents to a logical volume?

  • You selected this option

    -r or --resizefs

  • You selected this option

    -l +100%FREE

  • You selected this option

    -an or --activate no

  • You selected this option

    -a n or --alloc none

Question 11 of 15

An administrator is diagnosing an issue where a filesystem on their Linux server appears to be mounted read-only, preventing users from writing data. Which mount option should have been specified during the mounting process to allow both read and write operations on the filesystem?

  • You selected this option

    ro

  • You selected this option

    rw

  • You selected this option

    sync

  • You selected this option

    user

Question 12 of 15

A user reports that they are unable to write to a file named 'report.txt' located in their home directory. However, they have confirmed that they can read the file. Which of the following is the BEST action to take in order to grant the user write access to the file?

  • You selected this option

    Edit the /etc/fstab file to alter mounting options for the user's home directory

  • You selected this option

    Restart the file service to refresh user permissions

  • You selected this option

    Change the file permissions to allow write access for the user

  • You selected this option

    Change the ownership of the file using the chown command

Question 13 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 inaccurate

  • You selected this option

    The statement is accurate

Question 14 of 15

What is typically the primary consequence of unchecked memory leaks over time on a Linux system?

  • You selected this option

    Increased CPU utilization

  • You selected this option

    Network bandwidth limitations

  • You selected this option

    Memory exhaustion

  • You selected this option

    Increase in disk capacity

Question 15 of 15

A user reports that they cannot write to a file named 'report.txt' which should be writable by members of the group 'staff'. As a sysadmin, you check the permissions with ls -l report.txt and the output shows -rw-r--r-- 1 root staff 1048576 Jan 01 12:34 report.txt. What is the most likely reason for the user being unable to write to the file?

  • You selected this option

    The file is too large to be written to by group members

  • You selected this option

    The file is owned by the 'root' user, so only root can modify it

  • You selected this option

    The group 'staff' does not exist on the system

  • You selected this option

    The file only has write permissions for the owner