Key details for this exam, checked against the published exam outline
Each question shows the correct answer and an explanation of why it is right
A systems administrator needs to restore a backup to the /usr/app/data directory. Which of the following commands should the administrator use for this task?
The tar (tape archive) utility is the standard tool for archiving and compressing files in Linux. According to CompTIA Linux+ V8 objectives, administrators must be proficient in extracting data into specific target locations. The command tar -xvzf /tmp/backup.tar.gz -C /usr/app/data is the correct syntax for this operation.
The flags used in the command provide the following functionality:
-x: Instructs tar to extract the contents of the archive.
-v: Enables verbose output, showing the files as they are being extracted.
-z: Tells tar to filter the archive through gzip for decompression (required for .tar.gz files).
-f: Specifies the filename of the archive to be processed (/tmp/backup.tar.gz).
-C: Changes the directory to the specified path (/usr/app/data) before performing the extraction.
Using the -C flag is the most efficient and recommended way to restore a backup to a directory other than the current working directory. Without this flag, tar would extract the files into the current directory, which might not be the intended destination and could clutter the filesystem.
The other options are incorrect. Option B lacks the -z flag for decompression and incorrectly places the destination path after the archive filename without the -C flag, which tar would interpret as a request to extract only a specific file named /usr/app/data from inside the archive. Option C has the argument order reversed. Option D attempts to use shell redirection (>), which is used for text output and is not compatible with the tar extraction process for writing files to a directory.
Therefore, Option A is the verified correct command for restoring a compressed backup to a specific directory.
Users cannot access an application that is running inside containers. The administrator wants to validate whether the containers are running. Which of the following commands should the administrator use?
Container troubleshooting is a key competency within the Automation, Orchestration, and Scripting domain of CompTIA Linux+ V8. When users report that an application running inside containers is not accessible, one of the first validation steps is to confirm whether the containers are currently running.
The docker ps command is specifically designed to list running containers on the system. By default, it displays container IDs, image names, command executed, uptime, port mappings, and container names. This allows administrators to quickly determine whether the application container is active and whether it is exposing the expected ports. This aligns directly with Linux+ V8 guidance on container lifecycle management and operational validation.
The other options are not suitable for this purpose. docker start is used to start one or more stopped containers but does not display container status. docker run creates and starts a new container, which is not appropriate when the goal is only to check the status of existing containers. docker images lists locally available container images but provides no information about running or stopped containers.
Linux+ V8 documentation emphasizes the importance of using the correct Docker subcommands when diagnosing containerized applications. Verifying container runtime state using docker ps is a foundational troubleshooting step before investigating networking, firewall rules, or application-level errors.
Therefore, the correct command to validate whether containers are running is docker ps, making Answer B correct.
Which of the following utilities can securely delete a Linux directory from a filesystem and ensure it cannot be recovered?
The correct answer is B. shred because it is specifically designed to securely delete data by overwriting files multiple times, making data recovery extremely difficult or practically impossible. In Linux environments, simply deleting a file or directory does not remove the actual data from the disk; instead, it only removes the file's reference from the filesystem. Until that space is overwritten, the data can potentially be recovered using forensic tools.
The shred command mitigates this risk by overwriting the contents of files with random data repeatedly before deletion. This aligns with security best practices outlined in Linux+ objectives, particularly in the domain of data protection and secure data disposal. When used with appropriate options (such as recursive handling through scripting or combining with other commands), shred can be applied to files within directories to ensure secure deletion.
Option A (dd) is incorrect because while dd can overwrite disks or partitions with zeros or random data, it is not specifically designed for secure deletion of directories and requires careful manual targeting. Misuse can lead to accidental data loss.
Option C (unlink) is incorrect because it simply removes a file name from the filesystem, similar to rm, without overwriting the data. Therefore, the data remains recoverable.
Option D (rm) is also incorrect because it removes files or directories at the filesystem level but does not securely erase the data. Even with options like -r or -f, it does not overwrite file contents.
From a Linux+ security standpoint, shred is the most appropriate utility among the given options for secure data destruction, helping ensure sensitive information cannot be recovered.
A Linux administrator receives reports about MySQL service availability issues. The administrator observes the following information:
uptime -p shows the system has been up for only 2 minutes
journalctl shows messages indicating:
mysqld invoked oom-killer
mysqld cpuset=/ mems_allowed=0
Which of the following explains why the server was offline?
This scenario clearly indicates a memory exhaustion condition, which falls under the Troubleshooting domain of the CompTIA Linux+ V8 objectives. The most critical clue is the log entry stating that mysqld invoked oom-killer.
The OOM (Out-Of-Memory) killer is a Linux kernel mechanism that activates when the system runs critically low on available memory and cannot satisfy memory allocation requests. When this happens, the kernel selects a process---typically one consuming a large amount of memory---and forcibly terminates it to protect overall system stability. In this case, the MySQL daemon (mysqld) was identified as the process responsible for triggering the OOM condition.
The journalctl output explicitly confirms this behavior. Linux+ V8 documentation emphasizes that when the OOM killer is invoked, it is almost always due to physical memory exhaustion or insufficient swap space, not user intervention or application bugs alone. The additional log line showing mems_allowed=0 further supports the conclusion that the process could not allocate memory from available memory nodes.
The fact that uptime -p reports only 2 minutes of uptime strongly suggests that the system was either rebooted automatically or manually following the memory exhaustion event. Systems may reboot as part of recovery procedures after severe resource exhaustion, especially in production environments.
The other options can be ruled out. There is no indication of a user-initiated kill signal, filesystem corruption, or network connectivity issues. Network outages would not generate OOM killer messages, and filesystem errors would appear as I/O or disk-related errors in the logs.
Linux+ V8 best practices recommend addressing OOM issues by increasing system memory, tuning MySQL memory parameters, configuring swap space, or adjusting OOM scoring.
Therefore, the correct explanation is A. The process exhausted server memory.
A systems administrator manages multiple Linux servers and needs to set up a reliable and secure way to handle the complexity of managing event records on the OS and application levels. Which of the following should the administrator do?
Log management is a critical system management function highlighted in CompTIA Linux+ V8, particularly in multi-server environments. As the number of systems and applications grows, managing logs locally on each server becomes inefficient and error-prone.
The best solution is to implement a centralized log aggregation solution, making option B correct. Centralized logging collects logs from multiple systems and applications into a single, secure location. This simplifies monitoring, searching, correlation, auditing, and incident response. Common solutions include syslog servers, ELK/EFK stacks, and SIEM platforms.
Linux+ V8 documentation emphasizes centralized logging as a best practice for availability, troubleshooting, and security analysis. It enables administrators to detect patterns, investigate incidents, and maintain compliance more effectively than isolated log files.
The other options are insufficient on their own. On-demand retrieval does not scale well. Log backups protect data but do not simplify analysis. Log rotation manages disk usage but does not address distributed log complexity.
Therefore, the correct answer is B. Implement a centralized log aggregation solution.
149 questions covering all exam domains, starting from $20
Exam domains verified against: Official CompTIA XK0-006 exam guide, last checked September 2026.
Learn to identify the Linux boot process, kernel architecture, and filesystems. Manage kernel modules and hardware devices through device utilities.
Control file permissions and create symbolic and hard links. Add, remove, and modify user and group accounts using standard Linux tools.
Configure PAM, LDAP, and Kerberos for authentication. Set firewall rules using iptables, nftables, and UFW.
Sample question from this domain above: Q1
Automate tasks with Ansible and Puppet or CI/CD tools. Write shell scripts and Python scripts for system administration tasks.
Monitor system health using logs and event alerts. Diagnose and repair boot, mount, networking, and performance issues.
Common questions about the exam itself