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

Easiest Solution 2 Pass Your Certification Exams

XK0-005 CompTIA Linux+ Exam Free Practice Exam Questions (2025 Updated)

Prepare effectively for your CompTIA XK0-005 CompTIA Linux+ Exam certification with our extensive collection of free, high-quality practice questions. Each question is designed to mirror the actual exam format and objectives, complete with comprehensive answers and detailed explanations. Our materials are regularly updated for 2025, ensuring you have the most current resources to build confidence and succeed on your first attempt.

Page: 3 / 8
Total 487 questions

A non-privileged user is attempting to use commands that require elevated account permissions, but the commands are not successful. Which of the following most likely needs to be updated?

A.

/etc/passwd

B.

/etc/shadow

C.

/etc/sudoers

D.

/etc/bashrc

An administrator added a new disk to expand the current storage. Which of the following commands should the administrator run first to add the new disk to the LVM?

A.

vgextend

B.

lvextend

C.

pvcreate

D.

pvresize

A Linux administrator is attempting to capture all network traffic coming to the server from the 10.0.6.5 IP address. Which of the following commands should the administrator run on the server to achieve the goal?

A.

tcpdump ip 10.0.6.5

B.

tcpdump net 10.0.6.5

C.

tcpdump host 10.0.6.5

D.

tcpdump addr 10.0.6.5

Users report issues when trying to securely connect to a web server. The systems administrator receives the following outputs:

bash

firewall-cmd --list-all

(Only ports for ssh, cockpit, dhcp-client are listed.)

netstat -an | grep LISTEN

tcp 0 0 0.0.0.0:443 ... LISTEN

Which of the following actions will fix this issue?

A.

Restarting the firewall service

B.

Starting the web application

C.

Restarting the web application

D.

Opening firewall port 443

A systems administrator identifies multiple processes in a zombie state. Which of the following signals would be best for the administrator to send to the PPID?

A.

SIGTERM

B.

SIGHUP

C.

SIGQUIT

D.

SIGSTOP

An administrator thinks that the user Joe may be running an unauthorized process on a Linux server. Which of the following commands should the administrator run to confirm this idea?

A.

lsof -p 'Joe'

B.

top -u 'Joe'

C.

jobs -n 'Joe'

D.

ps -ax 'Joe'

A Linux administrator is tasked with moving files in a database server. The administrator must not overwrite any existing files. Which of the following commands would indicate that the file already exists?

A.

mv-ifilename/tmp/backup

B.

mv-bfilename/tmp/backup

C.

mv-nfilename/tmp/backup

D.

mv-ffilename/tmp/backup

A new database is installed on a server. To comply with the database vendor requirement, the huge page function should be set permanently. Which of the following commands will set this parameter?

A.

sysctl -a "vm.nr_hugepage=100"

B.

echo "vm.nr_hiigepage=100" >> /etc/sysconfig/hugepage.conf

C.

echo "nvm.nr_hugepage=100" >> /etc/modprobe.conf

D.

echo "vm.nr_hugepage=100" >> /etc/sysctl.conf

A Linux administrator needs to forward port 8000 on a remote server to port 8000 on a local server. Which of the following commands should the administrator run on the local server to achieve this goal?

A.

firewall-cmd --add-forward-port=port=8000=tcp=8000=remote

B.

iptables -A FORWARD -m state -p tcp -d remote --dport 9000 -j accept

C.

ssh -R 8000:localhost:9000 remote

D.

socat TCP4-LISTEN:8000,fork TCP4:remote:8000

Which of the following command sequences is used to install Linux software directly from source code?

A.

./config → ./compile → ./copy

B.

unzip → gcc → install

C.

./unpack → make exec → make copy

D.

./configure → make → make install

A systems administrator wants to list all local account names and their respective UIDs. Which of the following commands will provide output containing this information?

A.

cut -c: -f3,1 /etc/passwd

B.

cut -d: -s2,3 /etc/passwd

C.

cut -d: -f1,3 /etc/passwd

D.

cut -n: -f1,2 /etc/passwd

An application developer received a file with the following content:

##This is a sample Image ##

FROM ubuntu:18.04

MAINTAINER demohut@gtmail.com.hac

COPY . /app

RUN make /app

CMD python /app/app.py

RUN apt-get update

RUN apt-get install -y nginx

CMD ["echo","Image created"]

The developer must use this information to create a test bed environment and identify the image (myimage) as the first version for testing a new

application before moving it to production. Which of the following commands will accomplish this task?

A.

docker build -t myimage:1.0 .

B.

docker build -t myimage: .

C.

docker build -t myimage-1.0 .

D.

docker build -i myimage:1.0 .

A Linux administrator created a virtual clone of a physical server and would like to remove any existing entries related to SSH keys from outside entities on the virtual clone. Which of the following files should the administrator remove? (Select two).

A.

~/.ssh/authorized_keys

B.

~/.ssh/known_hosts

C.

/etc/ssh/ssh_config

D.

~/.ssh/config

E.

/etc/ssh/sshd_config

F.

/etc/ssh/ssh_host_rsa_key.pub

A systems administrator receives reports that several virtual machines in a host are responding slower than expected. Upon further investigation, the administrator obtains the following output from one of the affected systems:

Which of the following best explains the reported issue?

A.

The physical host is running out of CPU resources, leading to insufficient CPU time being allocated to virtual machines.

B.

The physical host has enough CPU cores, leading to users running more processes to compensate for the slower response times.

C.

The virtual machine has enough CPU cycles, leading to the system use percentage being higher than expected.

D.

The virtual machine is running out of CPU resources, leading to users experiencing longer response times.

Which of the following should be used to verify the integrity of a file?

A.

sha256sum

B.

fsck

C.

gpg —d

D.

hashcat

A Linux engineer wants to give read-write-execute permissions for the cloud_users directory to user Oliver. Which of the following commands should the engineer use?

A.

setfacl -L Oliver/cloud_users

B.

setfacl -x rwx/cloud_users

C.

setfacl -P rwx/cloud_users

D.

setfacl -m u:Oliver/cloud_users

The application team is having issues accessing their data in their /app filesystem. Given the following outputs:

Which of the following is the reason for this issue?

A.

The fllesystem was mounted incorrectly.

B.

The /etc/fstab configuration is wrong.

C.

A physical volume is missing.

D.

The data has been deleted.

A technician wants to temporarily use a Linux virtual machine as a router for the network segment 10.10.204.0/24. Which of the following commands should the technician issue? (Select three).

A.

echo "1" > /proc/sys/net/ipv4/ip_forward

B.

iptables -A FORWARD -j ACCEPT

C.

iptables -A PREROUTING -j ACCEPT

D.

iptables -t nat -s 10.10.204.0/24 -p tcp -A PREROUTING -j MASQUERADE

E.

echo "0" > /proc/sys/net/ipv4/ip_forward

F.

echo "1" > /proc/net/tcp

G.

iptables -t nat -s 10.10.204.0/24 -A POSTROUTING -j MASQUERADE

A Linux administrator was informed that the server time zone is incorrect. Which of the following commands should the administrator use to correct the time zone?

A.

timedatectl set-timezone America/New_York

B.

systemd-timezone set Asia/Tokyo

C.

systemctl configure-timezone Africa/Nairobi

D.

tzconfig configure Europe/London

Joe, a user, is unable to log in to the system. The Linux administrator checks the /etc/passwd file and reviews the following output:

Joe:x:1002:1002::/home/Joe:/sbin/nologin

Which of the following should the administrator do to fix this issue?

A.

Remove the x entry in the /etc/passwd file for Joe

B.

Change the /sbin/nologin entry to /bin/sh for Joe

C.

Issue the usermod -l Joe command

D.

Ensure that a corresponding entry is in the /etc/shadow file for Joe

Page: 3 / 8
Total 487 questions
Copyright © 2014-2025 Solution2Pass. All Rights Reserved