Pre-Winter Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: best70

XK0-006 CompTIA Linux+ V8 Exam Questions and Answers

Questions 4

A Linux administrator updates the DNS record for the company using:

cat /etc/bind/db.abc.com

The revised partial zone file is as follows:

ns1 IN A 192.168.40.251

ns2 IN A 192.168.40.252

www IN A 192.168.30.30

When the administrator attempts to resolve www.abc.com to its IP address, the domain name still points to its old IP mapping:

nslookup www.abc.com

Server: 192.168.40.251

Address: 192.168.40.251#53

Non-authoritative answer:

Name: www.abc.com

Address: 199.168.20.81

Which of the following should the administrator execute to retrieve the updated IP mapping?

Options:

A.

systemd-resolve query www.abc.com

B.

systemd-resolve status

C.

service nslcd reload

D.

resolvectl flush-caches

Buy Now
Questions 5

An administrator wants to search a file named myFile and look for all occurrences of strings containing at least five characters, where characters two and five are i, but character three is not b. Which of the following commands should the administrator execute to get the intended result?

Options:

A.

grep .a*^b-.a myFile

B.

grep .a., [a] myFile

C.

grepa^b*a myFile

D.

grep .i[^b].i myFile

Buy Now
Questions 6

An administrator wants to see all logs for the app.service systemd process. Which of the following commands should the administrator use to complete this task?

Options:

A.

cat /var/log/messages

B.

systemctl status app.service

C.

systemd-analyze unit-files app.service

D.

journalctl -u app.service

Buy Now
Questions 7

Which of the following commands should a Linux administrator use to determine the version of a kernel module?

Options:

A.

modprobe bluetooth

B.

lsmod bluetooth

C.

depmod bluetooth

D.

modinfo bluetooth

Buy Now
Questions 8

Which of the following filesystems contains non-persistent or volatile data?

Options:

A.

/boot

B.

/usr

C.

/proc

D.

/var

Buy Now
Questions 9

A Linux administrator needs to compare two files and provide the output in the following format:

2,3d1

< Line 2

< Line 3

4a3

Line 5

Which of the following commands should the administrator use to perform the task?

Options:

A.

comm

B.

awk

C.

file

D.

diff

Buy Now
Questions 10

A junior system administrator removed an LVM volume by mistake.

INSTRUCTIONS

Part 1

Review the output and select the appropriate command to begin the recovery process.

Part 2

Review the output and select the appropriate command to continue the recovery process.

Part 3

Review the output and select the appropriate command to complete the recovery process and access the underlying data.

XK0-006 Question 10

XK0-006 Question 10

XK0-006 Question 10

XK0-006 Question 10

Options:

Buy Now
Questions 11

Which of the following describes PEP 8?

Options:

A.

The style guide for Python code

B.

Python virtual environments

C.

A package installer for Python

D.

A Python variable holding octal values

Buy Now
Questions 12

A systems administrator needs to check access to all company servers. The administrator uses the following script, which does not complete:

for i in $(cat /home/user1.file)

do

echo $i

ssh $i uptime

Which of the following is missing from the script?

Options:

A.

fi

B.

else

C.

while

D.

done

Buy Now
Questions 13

Which of the following best describes the role of initrd?

Options:

A.

It is required to connect to the system via SSH.

B.

It contains basic kernel modules and drivers required to start the system.

C.

It contains trusted certificates and secret keys of the system.

D.

It is required to initialize a random device within a Linux system.

Buy Now
Questions 14

Which of the following describes what Ansible is used for in the context of IT infrastructure?

Options:

A.

Database management

B.

Configuration management

C.

Process management

D.

Asset management

Buy Now
Questions 15

Users report that a Linux system is unresponsive and simple commands take too long to complete. The Linux administrator logs in to the system and sees the following: Output 1:

10:06:29 up 235 day, 19:23, 2 users, load average: 8.71, 8.24, 7.71

XK0-006 Question 15

Which of the following is the system experiencing?

Options:

A.

High latency

B.

High uptime

C.

High CPU load

D.

High I/O wait times

Buy Now
Questions 16

A systems administrator needs to check the statuses of all the services on a Linux server. Which of the following commands accomplishes this task?

Options:

A.

systemctl is-active --services

B.

systemctl list-sockets --type=services

C.

systemctl is-enabled --services

D.

systemctl list-units --type=services

Buy Now
Questions 17

A Linux administrator wants to use AI to deploy infrastructure as code. Which of the following is a best practice regarding the use of AI for this task?

Options:

A.

Using copy and paste when possible

B.

Generating monolithic code

C.

Linting generated code

D.

Merging CI/CD pipelines

Buy Now
Questions 18

Which of the following is the location for built-in Linux executable files and utilities?

Options:

A.

/bin

B.

/var

C.

/etc

D.

/sys

Buy Now
Questions 19

The development team asks a Linux administrator to help diagnose a connectivity issue that is occurring with a newly developed software. The Linux administrator reviews the following output:

$ wget -vvv https://api.newapp.comptia.org/v2/health

Resolving proxy.comptia.org (proxy.comptia.org)... connected.

ERROR: The certificate of ' api.newapp.comptia.org ' is not trusted.

ERROR: The certificate of ' api.newapp.comptia.org ' does not have a known issuer.

Which of the following actions is the best way to resolve the issue?

Options:

A.

Verify the remote certificate is trustworthy, and add it to the local trusted certificates repository.

B.

Replace the remote certificate with a new self-signed CA and application certificate.

C.

Replace the expired CA certificate to permanently resolve the problem.

D.

Add option --no-check-certificate to wget command to permanently resolve the problem.

Buy Now
Questions 20

Which of the following is the best use of AI within a Linux environment?

Options:

A.

Giving full control of the Linux server to the AI engine

B.

Uploading company internal messaging for user validation

C.

Outsourcing proprietary source code development to the LLM

D.

Generating an nginx configuration file that can be used for testing

Buy Now
Questions 21

A Linux administrator installed a new program inside $HOME/.local/bin and is trying to execute it without using an absolute path. Which of the following should the administrator use for this task?

Options:

A.

export PATH=PATH:$HOME/.local/bin

B.

export $PATH=PATH:$HOME/.local/bin

C.

export PATH=$PATH:$HOME/.local/bin

D.

export $PATH=$PATH:$HOME/.local/bin

Buy Now
Questions 22

A Linux administrator notices that an application is having trouble connecting to an external database. Which of the following commands should the administrator use to validate the connection to the remote port exposed by a database server?

Options:

A.

dig MX db.comptia.org:3306

B.

nc -v db.comptia.org 3306

C.

arp -an | grep db.comptia.org | grep 3306

D.

ss -plant | grep 3306

Buy Now
Questions 23

A systems administrator is creating a backup copy of the /home/ directory. Which of the following commands allows the administrator to archive and compress the directory at the same time?

Options:

A.

cpio -o /backups/home.tar.xz /home/

B.

rsync -z /backups/home.tar.xz /home/

C.

tar -cJf /backups/home.tar.xz /home/

D.

dd of=/backups/home.tar.xz if=/home/

Buy Now
Questions 24

Which of the following can reduce the attack surface area in relation to Linux hardening?

Options:

A.

Customizing the log-in banner

B.

Reducing the number of directories created

C.

Extending the SSH startup timeout period

D.

Enforcing password strength and complexity

Buy Now
Questions 25

While hardening a system, an administrator runs a port scan with Nmap, which returned the following output:

XK0-006 Question 25

Which of the following is the best way to address this security issue?

Options:

A.

Configuring a firewall to block traffic on port 23 on the server

B.

Changing the system administrator ' s password to prevent unauthorized access

C.

Closing port 80 on the network switch to block traffic

D.

Disabling and removing the Telnet service on the server

Buy Now
Questions 26

Which of the following cryptographic functions ensures a hard drive is encrypted when not in use?

Options:

A.

GPG

B.

LUKS

C.

PKI certificates

D.

OpenSSL

Buy Now
Questions 27

Which of the following commands is used to ensure a service starts automatically at boot on a system using systemd?

Options:

A.

systemctl start httpd

B.

systemctl enable httpd

C.

systemctl status httpd

D.

systemctl reload httpd

Buy Now
Questions 28

A Linux software developer wants to use AI to optimize source code used in a commercial product. Which of the following steps should the developer take first?

Options:

A.

Research which available AI chatbots are best at optimizing source code.

B.

Verify that the company has a policy governing the use of AI in software development.

C.

Install a private LLM to use on the internal network for source code optimization.

D.

Use open-source LLMs that undergo regular security reviews by the community.

Buy Now
Questions 29

Which of the following commands can be used to display real-time running processes on a Linux system?

Options:

A.

ps

B.

top

C.

df

D.

free

Buy Now
Questions 30

A systems administrator needs to integrate a new storage array into the company ' s existing storage pool. The administrator wants to ensure that the server is able to detect the new storage array. Which of the following commands should the administrator use to ensure that the new storage array is presented to the systems?

Options:

A.

lsscsi

B.

lsusb

C.

lsipc

D.

lshw

Buy Now
Questions 31

After receiving a monitoring call, an administrator checks the Linux server for processes that have completed execution but have not been removed yet from the process table. Which of the following represents the process state for which the administrator should search?

Options:

A.

Z

B.

S

C.

D

D.

T

Buy Now
Questions 32

Which of the following commands should an administrator use to convert a KVM disk file to a different format?

Options:

A.

qemu-kvm

B.

qemu-ng

C.

qemu-io

D.

qemu-img

Buy Now
Questions 33

You are a systems administrator and have created an uncompressed backup of the

application directory. Several hours later, you must restore the application from backup.

INSTRUCTIONS

Within each tab, click on an object to form the appropriate command used to create the

backup and restore the application.

Command objects may only be used once, and not all will be used. Click the arrow to

remove any unwanted objects from your command.

If at any time you would like to bring back the initial state of the simulation, please click

the Reset All button.

XK0-006 Question 33

XK0-006 Question 33

Options:

Buy Now
Questions 34

Which of the following utilities supports the automation of security compliance and vulnerability management?

Options:

A.

SELinux

B.

Nmap

C.

AIDE

D.

OpenSCAP

Buy Now
Questions 35

Which of the following is a reason multiple password changes on the same day are not allowed?

Options:

A.

To avoid brute-forced password attacks by making them too long to perform

B.

To increase password complexity and the system ' s security

C.

To stop users from circulating through the password history to return to the originally used password

D.

To enforce using multifactor authentication with stronger encryption algorithms instead of passwords

Buy Now
Questions 36

A Linux server is experiencing slowness. A systems administrator obtains the following output:

top - load average: 2.43, 1.80, 2.32

Tasks: ... 154 zombie

%Cpu(s): 6.2 us, 5.1 sy, 0.0 ni, 79.2 id, 9.1 wa, ...

$ iostat -m 2

%user %nice %system %iowait %steal %idle

4.30 2.02 0.29 70.38 4.00 19.01

Which of the following explains the issue?

Options:

A.

The system ran out of swap space.

B.

The CPU is overutilized.

C.

The storage I/O latency is high.

D.

The system needs to be patched.

Buy Now
Questions 37

A Linux administrator needs to change the server name to comptia1. Which of the following commands should the administrator use?

Options:

A.

export HOSTNAME=comptia1

B.

echo " comptia1 " > > /etc/resolv.conf

C.

hostnamectl set-hostname comptia1

D.

systemctl daemon-reload -H comptia1

Buy Now
Questions 38

On a Kubernetes cluster, which of the following resources should be created in order to expose a port so it is publicly accessible on the internet?

Options:

A.

Deployment

B.

Network

C.

Service

D.

Pod

Buy Now
Questions 39

An administrator receives reports that a web service is not responding. The administrator reviews the following outputs:

XK0-006 Question 39

Which of the following is the reason the web service is not responding?

Options:

A.

The private key needs to be renamed from server.crt to server, key so the service can find it.

B.

The private key does not match the public key, and both keys should be replaced.

C.

The private key is not in the correct location and needs to be moved to the correct directory.

D.

The private key has the incorrect permissions and should be changed to 0755 for the service.

Buy Now
Questions 40

Which of the following commands is used to display detailed information about block devices on a Linux system?

Options:

A.

lsblk

B.

mount

C.

df

D.

fdisk

Buy Now
Questions 41

A systems administrator reviews the package management history and sees the following entries:

46 install httpd Install 9

47 update -y Upgrade 44

Which of the following commands should the administrator use to undo the installation of the httpd package from transaction 46?

Options:

A.

yum remove httpd

B.

yum history undo 46

C.

yum rollback 46

D.

yum erase 46

Buy Now
Questions 42

An administrator is investigating the reason a Linux workstation is not resolving the website http://www.comptia.org. The administrator executes some commands and receives the following output:

XK0-006 Question 42

Which of the following is the most likely cause?

Options:

A.

The static entry needs to be removed from /etc/hosts.

B.

The remote website does not support IPv6, and the workstation requires it.

C.

The firewall needs to be modified to allow outbound HTTP and HTTPS.

D.

The nameserver in /etc/resolv.conf needs to be updated to 8.8.8.8

Buy Now
Questions 43

To perform a live migration, which of the following must match on both host servers? (Choose two)

Options:

A.

USB ports

B.

Network speed

C.

Available swap

D.

CPU architecture

E.

Available memory

F.

Disk storage path

Buy Now
Questions 44

An administrator set up a new user account called " test " . However, the user is unable to change their password. Given the following output:

XK0-006 Question 44

Which of the following is the most likely cause of this issue?

Options:

A.

The SUID bit is missing on the /bin/passwd file.

B.

The password provided by the user " test " does not meet complexity requirements.

C.

The user " test " already changed the password today.

D.

The password has been disabled for user " test " .

Buy Now
Exam Code: XK0-006
Exam Name: CompTIA Linux+ V8 Exam
Last Update: Oct 8, 2026
Questions: 149

PDF + Testing Engine

$140

Testing Engine

$105

PDF (Q&A)

$90