CompTIA XK0-005 CompTIA Linux+ Certification Exam Practice Test

Page: 1 / 14
Total 378 questions
Question 1

A systems administrator is reviewing the following output on the text editor that is being used to update the company's internal database records:

Which of the following extensions should the systems administrator use when saving the file?



Answer : B


Question 2

A Linux systems administrator needs to add additional code to code that resides within a repository without changing the original code. Once completed, the additional code will be merged into the main branch. Which of the following commands should the administrator use first?



Answer : B


Question 3

The journald entries have filled a Linux machine's /var volume. Which of the following is the best command for a systems administrator to use to free up the disk space occupied by these entries?



Answer : A

To safely reduce the size of journald logs, journalctl --rotate forces log rotation, and journalctl --vacuum-time=1s removes entries older than the specified time. This approach efficiently manages log files without directly deleting files, which could risk corruption. CompTIA Linux+ advises controlled log management for journald to avoid unintended data loss. Reference: CompTIA Linux+ Study Guide.


Question 4

Users are reporting that a Linux server is responding slowly. A systems administrator troubleshooting the server issue sees the following:

# iostat -m 2

Linux 3.10.0-1160.66.1.el7.x86_64 (myhost) 10/19/2022 x86_64 (4 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle

24.30 0.01 0.29 50.38 4.00 19.01

Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn

sdd 15.65 0.48 0.83 4936250 8513501

# df -h

Filesystem Size Used Avail Use% Mounted on

devtmpfs 16G 0 16G 0% /dev

tmpfs 16G 64K 16G 1% /dev/shm

/dev/mapper/root 35G 8.8G 26G 26% /

/dev/sda2 497M 144M 354M 29% /boot

/dev/mapper/tmp 10G 38M 10G 1% /tmp

/dev/mapper/var 15G 13G 2.2G 86% /var

/dev/mapper/varlib 650G 397G 254G 62% /var/lib

/dev/mapper/varlog 15G 9.5G 5.5G 64% /var/log

/dev/mapper/varaudit 15G 72M 15G 1% /var/log/audit

Which of the following is most likely the issue?



Answer : A

The high %iowait value (50.38%) in the iostat output suggests that the CPU is waiting for I/O operations to complete, often caused by storage bottlenecks rather than a lack of CPU or memory resources. CompTIA Linux+ recommends checking I/O wait times to assess storage-related slowdowns, indicating potential disk access issues. Reference: CompTIA Linux+ Study Guide.


Question 5

Users report that they cannot access some files located in the /opt/finapp directory after a power outage caused an unexpected server restart. A Linux administrator examines the following filesystem details and system logs:

# mount | grep finapp

/dev/mapper/rhel-opt_finapp on /opt/finapp type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)

# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sda 8:0 0 931.5G 0 disk

sda1 8:1 0 1G 0 part /boot

sda2 8:2 0 930.5G 0 part

rhel-root 253:0 0 30.5G 0 lvm /

rhel-opt_finapp 253:1 0 900G 0 lvm /opt/finapp

# grep opt_finapp /var/log/messages

XFS (opt_finapp): Corruption detected in inode 3645, extent tree

Which of the following commands should the administrator run in an attempt to fix the filesystem?



Answer : B

For repairing XFS filesystems, the appropriate command is xfs_repair. Since the /opt/finapp directory resides on an XFS filesystem (indicated in the mount output), xfs_repair is suitable for diagnosing and fixing corruption in XFS inodes and extent trees. Using fdisk or fsck.ext4 is not appropriate for XFS filesystems, as these commands are intended for partitioning and ext4 filesystems, respectively. Reference: CompTIA Linux+ Study Guide.


Question 6

A Linux administrator updated the configuration file for the httpd web service. The administrator needs to apply the updated changes to the service without interrupting any running sessions. Which of the following commands should the administrator run to accomplish this task?



Answer : A

The systemctl reload httpd command reloads the Apache HTTP server configuration without terminating any existing connections. This is ideal for applying configuration changes without disrupting the current web traffic, ensuring seamless operation.


Question 7

A network administrator issues the dig www.foo.com command and receives an NXDOMAIN response. Which of the following files should the administrator check first?



Answer : A

The NXDOMAIN response indicates that the domain name could not be resolved. The administrator should first check /etc/resolv.conf, which contains the DNS server configuration. If the DNS servers listed are incorrect or unreachable, domain resolution will fail.


Page:    1 / 14   
Total 378 questions