Month end Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70special

CompTIA XK0-006 CompTIA Linux+ V8 Exam Exam Practice Test

Page: 1 / 9
Total 87 questions

CompTIA Linux+ V8 Exam Questions and Answers

Testing Engine

  • Product Type: Testing Engine
$37.5  $124.99

PDF Study Guide

  • Product Type: PDF Study Guide
$33  $109.99
Question 1

A Linux administrator is making changes to local files that are part of a Git repository. The administrator needs to retrieve changes from the remote Git repository. Which of the following commands should the administrator use to save the local modifications for later review?

Options:

A.

git stash

B.

git pull

C.

git merge

D.

git fetch

Question 2

A systems administrator needs to set the IP address of a new DNS server. Which of the following files should the administrator modify to complete this task?

Options:

A.

/etc/whois.conf

B.

/etc/resolv.conf

C.

/etc/nsswitch.conf

D.

/etc/dnsmasq.conf

Question 3

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

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

Question 4

A systems administrator is configuring new Linux systems and needs to enable passwordless authentication between two of the servers. Which of the following commands should the administrator use?

Options:

A.

ssh-keygen -t rsa && ssh-copy-id -i ~/.ssh/id_rsa.pub john@server2

B.

ssh-keyscan -t rsa && ssh-copy-id john@server2 -i ~/.ssh/key

C.

ssh-agent -i rsa && ssh-copy-id ~/.ssh/key john@server2

D.

ssh-add -t rsa && scp -rp ~/.ssh john@server2

Question 5

A systems administrator wants to prevent the current contents of a file from being overwritten and wants to allow new additions at the end of the file. Which of the following commands should the administrator use?

Options:

A.

setenforce file

B.

setfacl -m m::t file

C.

chattr +a file

D.

chmod +t file

Question 6

A systems administrator is preparing a Linux system for application setup. The administrator needs to create an environment variable with a persistent value in one of the user accounts. Which of the following commands should the administrator use for this task?

Options:

A.

export "VAR=SomeValue" >> ~/.ssh/profile

B.

export VAR=value

C.

VAR=value

D.

echo "export VAR=value" >> ~/.bashrc

Question 7

An administrator needs to remove the directory /home/user1/data and all of its contents. Which of the following commands should the administrator use?

Options:

A.

rmdir -p /home/user1/data

B.

ln -d /home/user1/data

C.

rm -r /home/user1/data

D.

cut -d /home/user1/data

Question 8

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 to its IP address, the domain name still points to its old IP mapping:

nslookup

Server: 192.168.40.251

Address: 192.168.40.251#53

Non-authoritative answer:

Name:

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

Question 9

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.

Options:

Question 10

An administrator needs to verify the user ID, home directory, and assigned shell for the user named "accounting." Which of the following commands should the administrator use to retrieve this information?

Options:

A.

getent passwd accounting

B.

id accounting

C.

grep accounting /etc/shadow

D.

who accounting

Question 11

A systems administrator wants to review the amount of time the NetworkManager service took to start. Which of the following commands accomplishes this goal?

Options:

A.

resolvectl

B.

journalctl

C.

systemctl daemon-reload

D.

systemd-analyze blame

Question 12

A Linux systems administrator needs to extract the contents of a file named /home/dev/web.bkp to the /var/www/html/ directory. Which of the following commands should the administrator use?

Options:

A.

cd /var/www/html/ && gzip -c /home/dev/web.bkp | tar xf -

B.

pushd /var/www/html/ && cpio -idv < /home/dev/web.bkp && popd

C.

tar -c -f /home/dev/web.bkp /var/www/html/

D.

unzip -c /home/dev/web.bkp /var/www/html/

Question 13

A systems administrator receives reports from users who are having issues while trying to modify newly created files in a shared directory. The administrator sees the following outputs:

Which of the following provides the best resolution to this issue?

Options:

A.

Adding a setuid bit to the user in the shared folder

B.

Manually changing the group of the newly created files

C.

Changing all directory contents to be writable and readable for everyone

D.

Adding a setgid bit to the group in the shared folder

Question 14

A systems administrator attempts to edit a file as root, but receives the following error:

Which of the following commands allows the administrator to edit the file?

Options:

A.

chown root /etc/resolv.conf

B.

chattr -i /etc/resolv.conf

C.

chmod 750 /etc/resolv.conf

D.

chgrp root /etc/resolv.conf

Question 15

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

Question 16

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

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

Question 17

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

Question 18

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

Options:

A.

SELinux

B.

Nmap

C.

AIDE

D.

OpenSCAP

Question 19

A Linux user runs the following command:

nohup ping comptia.com &

Which of the following commands should the user execute to attach the process to the current terminal?

Options:

A.

renice

B.

jobs

C.

exec

D.

fg

Question 20

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.

Question 21

A Linux administrator needs to create and then connect to the app-01-image container. Which of the following commands accomplishes this task?

Options:

A.

docker run -it app-01-image

B.

docker start -td app-01-image

C.

docker build -ic app-01-image

D.

docker exec -dc app-01-image

Question 22

Which of the following best describes a use case for playbooks in a Linux system?

Options:

A.

To provide a set of tasks and configurations to deploy an application

B.

To provide the instructions for implementing version control on a repository

C.

To provide the security information required for a container

D.

To provide the storage volume information required for a pod

Question 23

Joe, a user, has taken a position previously held by Ann. As a systems administrator, you

need to archive all the files from Ann's home directory and extract them into Joe's home

directory.

INSTRUCTIONS

Within each tab, click on an object to form the appropriate commands. Command objects may only be used once, but the spacebar _ object may be used multiple times. Not all objects will be used.

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

Options:

Question 24

An administrator updates the network configuration on a server but wants to ensure the change will not cause an outage if something goes wrong. Which of the following commands allows the administrator to accomplish this goal?

Options:

A.

netplan try

B.

netplan rebind

C.

netplan ip

D.

netplan apply

Question 25

A DevOps engineer made some changes to files in a local repository. The engineer realizes that the changes broke the application and the changes need to be reverted back. Which of the following commands is the best way to accomplish this task?

Options:

A.

git pull

B.

git reset

C.

git rebase

D.

git stash

Question 26

An administrator receives the following output while attempting to unmount a filesystem:

umount /data1: target is busy.

Which of the following commands should the administrator run next to determine why the filesystem is busy?

Options:

A.

ps -f /data1

B.

du -sh /data1

C.

top -d /data1

D.

lsof | grep /data1

Page: 1 / 9
Total 87 questions