Pre-Summer Sale Special - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > CompTIA > Linux+ > XK0-006

XK0-006 CompTIA Linux+ V8 Exam Question and Answers

Question # 4

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?

A.

Z

B.

S

C.

D

D.

T

Full Access
Question # 5

Which of the following commands should an administrator use to see a full hardware inventory of a Linux system?

A.

dmidecode

B.

lsmod

C.

dmesg

D.

lscpu

Full Access
Question # 6

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.

Full Access
Question # 7

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?

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/

Full Access
Question # 8

Which of the following is a protocol for accessing distributed directory services containing a hierarchy of users, groups, machines, and organizational units?

A.

SMB

B.

TLS

C.

LDAP

D.

KRB-5

Full Access
Question # 9

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

A.

/boot

B.

/usr

C.

/proc

D.

/var

Full Access
Question # 10

A Linux user frequently tests shell scripts located in the /home/user/scripts directory. Which of the following commands allows the user to run the program by invoking only the script name?

A.

export SHELL=$SHELL=/home/user/scripts

B.

export TERM=$TERM=/home/user/scripts

C.

export PATH=$PATH:/home/user/scripts

D.

export alias /home/user/scripts= ' /bin '

Full Access
Question # 11

Which of the following statements best describes Ansible?

A.

A tool used for monitoring cloud infrastructure

B.

A software configuration tool with its own declarative, Ruby-based language

C.

A CI/CD tool that allows automation using pipelines

D.

A tool that provides automation using playbooks written in YAML

Full Access
Question # 12

In the echo " profile-$num-$name " line of a shell script, the variable $num seems to not be expanding during execution. Which of the following notations ensures the value is expanded?

A.

echo " profile-$(num)-$name "

B.

echo ' profile-$num-$name '

C.

echo " profile- ' $num ' -$name "

D.

echo " profile-${num}-$name "

Full Access
Question # 13

Which of the following passwords is the most complex?

A.

H3sa1dt01d

B.

he$@ID$heTold

C.

H3s@1dSh3t0|d

D.

HeSaidShetold

Full Access
Question # 14

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

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

Full Access
Question # 15

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?

A.

getent passwd accounting

B.

id accounting

C.

grep accounting /etc/shadow

D.

who accounting

Full Access
Question # 16

A user reports Issues v/hen trying to connect to one ot the Linux servers. The server administrator reviews the following outputs:

Output 1:

Kernel panic not syncing: Fatal Machine check

Fid: 0, comm; swapper Tainted: G M ------------------ 4.18.0-553.8.1.cl8_10.x86_64 #1

Call Trace:

< #mc > [rrrrrrrrs:4er..i4i] ? panic+ox7n/oxi43

[] ? mcc_panic+0x21f/0x240

[] ? do_machine_check+0xal8/0xae0

[] ? intel idie+0xbi/0xi70

[] ? machino_check+0xlc/0x30

[] ? intel_idle+0xbl/0xl70

«EOE» [] ? hrtimer 8tart+0xlB/0x20

[] ? cpuidle_idle_cail+0xa7/0xl40

I| ? cpu_idle+0xbfc/0xll0

[] ? Start_secondary+0x202/0x245

Output 2:

[325926.243631] mce: [Error] : CPU 22: Machine Check Exception: 7 Bank 0: bd80000000000134

1325926.247004| nice: (Error): Machine check events logged

[325991.358038] race: [Error] : KIP 10: < ffffffff83584719* (copy user enhanced fast strir.q+0x9/0x20)

[325991.358038] mce: [Error] : tsc 31ea89256a735 ADDR 3cdl889000 MISC 8c

[325991.350033] mce: [Error] : PROCESSOR 0:50657 TIME 15945B1695 SOCKET 0 APTC 16 microcode rrrrtrrr

[325991.358038] mce: [Error] : Run the above through ' rr.ccloq —ascii*

[325991.358038] mce: [Error] : Machine check: Action required: unknown MCACOD

[325991.3511038] Kernel panic not syncing: Fatal machine check

Which of the following statements describes the cause and resolution for this issue?

A.

The current kernel is corrupted and should be reinstalled.

B.

The messages point to a hardware issue that should be addressed by the server team.

C.

The system has crashed and needs to be rebooted to fix the issue.

D.

All available CPUs have been exhausted, and a new CPU should be added.

Full Access
Question # 17

Application owners are reporting that their application stops responding after several days of running, and they need to restart it. A Linux administrator obtains the following details from the dmesg command:

invoked oom-killer

Call Trace:

out_of_memory

oom_kill_process

The application owners mentioned that resources to the system have been increased, and the error takes longer to appear. Which of the following best describes the reason the process is being terminated by OOM?

A.

The CPU type is incompatible with the application.

B.

The kernel has panicked.

C.

The application might have a memory leak.

D.

The swap configuration is not correctly sized.

Full Access
Question # 18

A systems administrator is writing a script to analyze the number of files in the directory /opt/application/home/. Which of the following commands should the administrator use in conjunction with ls -l | to count the files?

A.

less

B.

tail -f

C.

tr -c

D.

wc -l

Full Access
Question # 19

Which of the following most accurately describes a webhook?

A.

An authentication method for web-server communication

B.

An SNMP-based API for network device monitoring

C.

A means to transmit sensitive information between systems

D.

An HTTP-based callback function

Full Access
Question # 20

A small group of remote users needs permission to run some administrative commands on a Linux server. Which of the following approaches is the best way to address this request?

A.

Set the sticky bit in all binaries requested for use by this group of users.

B.

Request a list of utilities they need to use with elevated privileges, and add the appropriate rules.

C.

Set the configuration parameter PermitRootLogin on sshd_config to " yes " and share the root password with this group of users.

D.

Create a Linux group, add the users, and configure this group on /etc/sudoers to use sudo, thus allowing them to switch to root user.

Full Access
Question # 21

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

A.

export HOSTNAME=comptia1

B.

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

C.

hostnamectl set-hostname comptia1

D.

systemctl daemon-reload -H comptia1

Full Access
Question # 22

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?

A.

Deployment

B.

Network

C.

Service

D.

Pod

Full Access
Question # 23

Which of the following is the main reason for setting up password expiry policies?

A.

To avoid using the same passwords repeatedly

B.

To mitigate the use of exposed passwords

C.

To force usage of passwordless authentication

D.

To increase password strength and complexity

Full Access
Question # 24

Which of the following Ansible components is used to define groups and individual hosts and can include variables specific to each host or group?

A.

Modules

B.

Inventory

C.

Playbooks

D.

Handlers

Full Access
Question # 25

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?

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

Full Access
Question # 26

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?

A.

lsscsi

B.

lsusb

C.

lsipc

D.

lshw

Full Access
Question # 27

An administrator receives a report that a user is unable to execute the runreports utility. The administrator logs in as the user, runs the following commands, and receives the following output:

$ runreports

runreports: command not found

$ ls -l /usr/local/bin

-rwxr-xr-x 1 root root 29 May 10 11:31 runreports

$ echo $PATH

/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

Which of the following best describes the issue and how to resolve it?

A.

The runreports utility is not in the user ' s path. The administrator should modify the .bash_profile file.

B.

The runreports utility is a shell script but not owned by the user. The administrator should use chown.

C.

The user does not have the correct SELinux context. The administrator should modify the SELinux template.

D.

The runreports utility does not have execute permissions. The administrator should add execute permissions.

Full Access
Question # 28

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

A.

USB ports

B.

Network speed

C.

Available swap

D.

CPU architecture

E.

Available memory

F.

Disk storage path

Full Access
Question # 29

A systems administrator wants to review the logs from an Apache 2 error.log file in real time and save the information to another file for later review. Which of the following commands should the administrator use?

A.

tail -f /var/log/apache2/error.log > logfile.txt

B.

tail -f /var/log/apache2/error.log | logfile.txt

C.

tail -f /var/log/apache2/error.log > > logfile.txt

D.

tail -f /var/log/apache2/error.log | tee logfile.txt

Full Access
Question # 30

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?

A.

systemd-resolve query www.abc.com

B.

systemd-resolve status

C.

service nslcd reload

D.

resolvectl flush-caches

Full Access
Question # 31

Users cannot access a server after it has been restarted. At the server console, the administrator runs the following commands;

Which of the following is the cause of the issue?

A.

The DNS entry does not have a valid IP address.

B.

The SSH service has not been allowed on the firewall.

C.

The server load average is too high.

D.

The wrong protocol is being used to connect to the web server.

Full Access
Question # 32

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

A.

/bin

B.

/var

C.

/etc

D.

/sys

Full Access
Question # 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.

Full Access
Question # 34

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?

A.

tar -xvzf /tmp/backup.tar.gz -C /usr/app/data

B.

tar -xvf /tmp/backup.tar.gz /usr/app/data

C.

tar -xvzf /usr/app/data /tmp/backup.tar.gz

D.

tar -xvzf /tmp/backup.tar.gz > /usr/app/data

Full Access
Question # 35

An administrator attempts to install updates on a Linux system but receives error messages regarding a specific repository. Which of the following commands should the administrator use to verify that the repository is installed and enabled?

A.

yum repo-pkgs

B.

yum list installed repos

C.

yum reposync available

D.

yum repolist all

Full Access
Question # 36

An administrator is trying to terminate a process that is not responding. Which of the following commands should the administrator use in order to force the termination of the process?

A.

kill PID

B.

kill -1 PID

C.

kill -9 PID

D.

kill -15 PID

Full Access
Question # 37

A systems administrator is having issues with a third-party API endpoint. The administrator receives the following output:

Which of the following actions should the administrator take to resolve the issue?

A.

Open a secure port in the server ' s firewall.

B.

Request a new API endpoint from a third party.

C.

Review and fix the DNS client configuration file.

D.

Enable internet connectivity on the host.

Full Access
Question # 38

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?

A.

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

B.

export VAR=value

C.

VAR=value

D.

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

Full Access
Question # 39

Which of the following is the first step when starting a new Python project on a Linux system?

A.

python -m venv /path/to/project

B.

python -m pip install -r /path/to/project

C.

export PYTHON_PATH=/path/to/project

D.

python -m source /path/to/project

Full Access
Question # 40

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

A.

lsblk

B.

mount

C.

df

D.

fdisk

Full Access
Question # 41

A systems administrator is decommissioning a service. Which of the following commands should the administrator use to make sure users cannot start the service again?

A.

systemctl mask service

B.

systemctl kill service

C.

systemctl isolate service

D.

systemctl disable service

Full Access
Question # 42

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

A.

Database management

B.

Configuration management

C.

Process management

D.

Asset management

Full Access
Question # 43

A Linux administrator wants to make the enable_auth variable set to 1 and available to the environment of subsequently executed commands. Which of the following should the administrator use for this task?

A.

let ENABLE_AUTH=1

B.

ENABLE_AUTH=1

C.

ENABLE_AUTH=$(echo $ENABLE_AUTH)

D.

export ENABLE_AUTH=1

Full Access
Question # 44

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?

A.

netplan try

B.

netplan rebind

C.

netplan ip

D.

netplan apply

Full Access