00:15:00

CompTIA Linux+ Practice Test (XK0-006)

Use the form below to configure your CompTIA Linux+ Practice Test (XK0-006). 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-006 (V8)
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-006 (V8) Information

CompTIA Linux+ (v8 / XK0-006) Exam

The CompTIA Linux+ (XK0-006) 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-006 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-006 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-006) 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-006 (V8) 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
    Services and User Management
    Security
    Automation, Orchestration, and Scripting
    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 15

A system administrator needs to permanently add the nomodeset kernel parameter to the GRUB 2 boot-loader configuration. Which of the following methods should the administrator use to ensure the change persists after a kernel update?

  • Edit the GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub and then run update-grub.

  • Add the line kernel.nomodeset=1 to the /etc/sysctl.conf file and run sysctl -p.

  • Directly edit the /boot/grub/grub.cfg file and add the parameter to the linux line.

  • Append nomodeset to the end of the /proc/cmdline file.

Question 2 of 15

A Linux system administrator needs to modify the system-wide configuration for network services on a server. According to the Filesystem Hierarchy Standard (FHS), in which directory should the administrator primarily look for these configuration files?

  • /var

  • /home

  • /boot

  • /etc

Question 3 of 15

You are hardening a Linux server that sometimes remounts its root filesystem read-only during maintenance. A health-check script must confirm at runtime that /tmp is really mounted with the noexec flag, even if /etc/mtab is unavailable or out of date. Which single file should the script read to obtain an authoritative, up-to-date list of all mounts and their current options?

  • /proc/mounts

  • /proc/partitions

  • /etc/fstab

  • /run/mount/utab

Question 4 of 15

A system administrator is teaching a new intern about the Filesystem Hierarchy Standard (FHS) on a Linux server. The intern asks about the purpose of the topmost directory. According to the FHS, what is the primary role of the root (/) directory?

  • It contains the majority of multi-user utilities, applications, and their libraries.

  • It contains all system-wide configuration files and host-specific settings.

  • It serves as the primary hierarchy and contains all other directories and files.

  • It contains variable data files that change during system operation, such as logs and mail spools.

Question 5 of 15

You have booted a Linux server into single-user (rescue) mode after an unexpected power loss. Before you run fsck on the root file system (/), you must switch that file system to read-only without changing its mount point or rebooting. Which single command accomplishes this task?

  • mount -o remount,nosuid /

  • mount -o bind,ro / /

  • mount -o remount,rw /

  • mount -o remount,ro /

Question 6 of 15

A system administrator is running a lengthy script, ./update.sh, that generates important progress information to standard output. The administrator needs to capture this output in a file named update.log for later analysis, but also wants to monitor the script's execution in real time on the terminal. Which of the following commands will achieve this?

  • ./update.sh > update.log

  • ./update.sh | tee update.log

  • ./update.sh > update.log && tail -f update.log

  • tee update.log < ./update.sh

Question 7 of 15

A system administrator is running a script that generates a large amount of verbose output to both standard output and standard error. The administrator only needs to check the script's exit code and wants to prevent all output from being displayed on the terminal or written to a log file. Which of the following commands will achieve this?

  • script.sh > /dev/random

  • script.sh | /dev/null

  • script.sh > /dev/zero

  • script.sh > /dev/null 2>&1

Question 8 of 15

During a new Linux deployment you create a separate logical volume for user data so the operating system can be re-installed without touching personal files. According to the Filesystem Hierarchy Standard (FHS), to which top-level directory should you mount this volume so that each user's dotfiles and other personal data are found automatically by shells, desktop environments, and standard tools without any extra configuration?

  • /opt

  • /home

  • /usr/local

  • /srv

Question 9 of 15

You are preparing a RHEL-based server that boots with GRUB 2 on a BIOS system. The kernel must always start with the noapic parameter, and the setting must be preserved when new kernels are installed. After making the change you will regenerate the boot-loader configuration with:

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

Which single configuration file should you edit before running the command so the new parameter is applied persistently?

  • /boot/grub2/custom.cfg

  • /boot/grub2/grub.cfg

  • /etc/grub.d/10_linux

  • /etc/default/grub

Question 10 of 15

You need to permanently disable IPv6 on a BIOS-based RHEL server that uses GRUB 2. The change must survive future kernel updates and must follow the vendor-recommended workflow for modifying the boot loader configuration. Which action will achieve this goal?

  • Add "ipv6.disable=1" to the GRUB_CMDLINE_LINUX line in /etc/default/grub and run "grub2-mkconfig -o /boot/grub2/grub.cfg".

  • Add "ipv6.disable=1" to the DEFAULTKERNEL variable in /etc/sysconfig/kernel and run "dracut -f" to rebuild the initramfs.

  • Create a custom menuentry with "ipv6.disable=1" inside /etc/grub.d/40_custom and run "grubby --update-kernel=ALL".

  • Append "ipv6.disable=1" directly to the linux line in /boot/grub2/grub.cfg and save the file.

Question 11 of 15

A network administrator is using iperf3 to troubleshoot network throughput between two Linux servers, ServerA (10.0.1.10) and ServerB (10.0.1.20). The administrator starts the iperf3 server process on ServerA. To measure the download speed from ServerA to ServerB, which command should be executed on ServerB?

  • iperf3 -s -c 10.0.1.10

  • iperf3 -c 10.0.1.10 --get-server-output

  • iperf3 -c 10.0.1.10

  • iperf3 -c 10.0.1.10 -R

Question 12 of 15

During an overnight maintenance window you plan to shrink the ext4 file system located on /dev/mapper/vgdata-lvarchive. Before reducing the size of the underlying logical volume, you need to know exactly how many file-system blocks the volume can be reduced to so that you do not make it smaller than the data it contains. The file system is currently unmounted, and you want a command that only reports this minimum size without modifying anything. Which single command satisfies this requirement?

  • resize2fs -P /dev/mapper/vgdata-lvarchive

  • e2fsck -f /dev/mapper/vgdata-lvarchive

  • resize2fs -f /dev/mapper/vgdata-lvarchive

  • resize2fs -M /dev/mapper/vgdata-lvarchive

Question 13 of 15

You are writing a Bash deployment script that must append the following stanza to /etc/httpd/conf.d/example.conf:

<VirtualHost *:80>
    ServerName $SERVERNAME
    DocumentRoot $DOCROOT
</VirtualHost>

The script has two requirements:

  • The $SERVERNAME and $DOCROOT variables must be substituted by the parent shell before the text is written.
  • The four leading spaces that indent each inner line are literal spaces and must be preserved exactly as written.

Which of the following command constructions meets both requirements and appends the stanza to the file?

  • cat <<< "<VirtualHost *:80> ServerName $SERVERNAME DocumentRoot $DOCROOT " >> /etc/httpd/conf.d/example.conf

  • cat <<'EOF' >> /etc/httpd/conf.d/example.conf <VirtualHost *:80> ServerName $SERVERNAME DocumentRoot $DOCROOT EOF

  • cat <> /etc/httpd/conf.d/example.conf <VirtualHost *:80> ServerName $SERVERNAME DocumentRoot $DOCROOT EOF

  • cat <<-EOF >> /etc/httpd/conf.d/example.conf <VirtualHost *:80> ServerName $SERVERNAME DocumentRoot $DOCROOT EOF

Question 14 of 15

During installation of a new x86_64 server, the root filesystem is placed inside a LUKS-encrypted logical volume (LVM). After running dracut to regenerate the initial RAM disk, the machine boots successfully and asks for the passphrase early in the boot sequence. Which statement best explains why the initramfs stage is mandatory for this setup?

  • It allows GRUB2 to read /etc/default/grub from the encrypted disk and rebuild the boot menu on every startup.

  • It supplies the user-space tools and kernel modules needed to unlock the LUKS container and activate the LVM so the kernel can mount the real root filesystem.

  • It contains the systemd unit files that start normal services after the kernel boots into the real root filesystem.

  • It provides firmware code that lets the BIOS or UEFI locate and launch the bootloader on the disk.

Question 15 of 15

A Linux administrator has placed a new set of custom scripts in the /usr/local/sbin directory and made them executable. When the administrator tries to run a script by typing only its name, the shell returns a "command not found" error. The output of echo $PATH is as follows:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Which of the following commands must the administrator run to allow the scripts in /usr/local/sbin to be executed by name for the duration of the current session?

  • source /usr/local/sbin

  • export PATH="/usr/local/sbin"

  • export PATH=$PATH:/usr/local/sbin

  • chmod +x /usr/local/sbin/*