CompTIA XK0-005 Online Practice
Questions and Exam Preparation
XK0-005 Exam Details
Exam Code
:XK0-005
Exam Name
:CompTIA Linux+
Certification
:CompTIA Certifications
Vendor
:CompTIA
Total Questions
:476 Q&As
Last Updated
:May 25, 2026
CompTIA XK0-005 Online Questions &
Answers
Question 341:
A Linux administrator needs to restart a server and wants to see if any users are currently connected to it. Which of the following commands should the administrator run to find this information?
A. man B. id C. w D. host
C. w
Explanation
Question 342:
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
C. kill -9 PID
Explanation
Question 343:
In order to copy data from another VLAN, a systems administrator wants to temporarily assign IP address 10.0.6 5/24 to the newly added network interface enp1s0f1. Which of the following commands should the administrator run to achieve the goal?
A. ip addr add 10.0.6.5/24 dev enpls0f1 B. echo "IPV4_ADDRESS=10.0.6.5/24" > /etc/sysconfig/network-scripts/ifcfg-enplsOfl C. ifconfig 10.0.6.5/24 enpsIs0f1 D. nmcli conn add lpv4.address-10.0.6.5/24 ifname enpls0f1
A. ip addr add 10.0.6.5/24 dev enpls0f1
Explanation
The command ip addr add 10.0.6.5/24 dev enp1s0f1 will achieve the goal of temporarily assigning IP address 10.0.6.5/24 to the newly added network interface enp1s0f1. The ip command is a tool for managing network interfaces and routing on Linux systems. The addr option specifies the address manipulation mode. The add option adds a new address to an interface. The 10.0.6.5/24 is the IP address and the subnet mask in CIDR notation. The dev option specifies the device name. The enp1s0f1 is the name of the network interface. The command ip addr add 10.0.6.5/24 dev enp1s0f1 will add the IP address 10.0.6.5/24 to the network interface enp1s0f1, which will allow the administrator to copy data from another VLAN. This is the correct command to use to achieve the goal. The other options are incorrect because they either do not add a new address to an interface (echo "IPV4_ADDRESS=10.0.6.5/24" > /etc/sysconfig/network-scripts/ifcfgenp1s0f1 or ifconfig 10.0.6.5/24 enp1s0f1) or do not use the correct syntax for the command (nmcli conn add ipv4.address-10.0.6.5/24 ifname enp1s0f1 instead of nmcli conn add type ethernet ipv4.address 10.0.6.5/24 ifname enp1s0f1).
A systems administrator needs to validate that the dm_multipath driver was loaded in a Linux system. Which of the following commands should the administrator use?
A. lsmod | grep dm_multipath B. modinfo | grep dm_multipath C. insmod | grep dm_multipath D. modprobe | grep dm_multipath
A. lsmod | grep dm_multipath
Explanation
Question 345:
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
D. wc -l
Explanation
Question 346:
An organization's business office needs to collaborate on quarterly reports and asks the systems administrator to create a finance group. The administrator creates the following directory: drwxrwxr-x Business Business |j096 Oct 15 16:40 Q1 Which of the following commands will allow all members of the finance group to have group ownership of all files created in the Q1 directory while ensuring that members of the business group preserve access? (Select two).
A. chmod g+s Q1/ B. chmod u+s Q1/ C. chmod a+x Q1/ D. chown Finance Q1/ E. chmod g+x Q1/
A. chmod g+s Q1/ D. chown Finance Q1/
Explanation
To ensure all files created in Q1 inherit the group ownership of finance, the chmod g+s command sets the group ID (SGID) on the directory, ensuring new files belong to the group of the directory. chown Finance Q1/ changes the group ownership of Q1 to Finance, allowing Finance group members access. These settings facilitate collaborative permissions as per CompTIA Linux+ recommendations for group-based file sharing.
CompTIA Linux+ Study Guide.
Question 347:
DRAG DROP
You have been asked to parse a log file of logins to determine various information about who is logging in and when.
INSTRUCTIONS
Open and inspect the Login log file.
Drag and drop the correct commands onto the output that was generated from that command.
Tokens can be used only once and not all 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.
Select and Place:
Question 348:
An administrator is running a web server in a container named web, but none of the error output is not showing. Which of the following should the administrator use to generate the errors on the container?
A. docker-compose inspect WEB B. dockerlogs WEB C. dockerrun --nameWEB --volume/dev/stdout:/var/log/nginx/error.log D. dockerps WEB -f
B. dockerlogs WEB
Explanation
The docker logs command is used to fetch the logs of a container. If the error output is not showing for a running container, the docker logs command can be used to view these details56.
The administrator verifies the drive UUID correct, and user1 confirms the drive should be mounted as My Documents in the home directory.
Which of the following can the administrator do to fix the issues with mounting the drive? (Select two).
A. Rename the mount file to home-user1-My\x20Documents.mount. B. Rename the mount file to home-user1-my-documents.mount. C. Change the What entry to /dev/drv/disk/by-uuid/94afc9b2\-ac34\-ccff\-88ae\- 297ab3c7ff34. D. Change the Where entry to Where=/home/user1/my\ documents. E. Change the Where entry to Where=/home/user1/My\x20Documents. F. Add quotes to the What and Where entries, such as What="/dev/drv/disk/by- uuid/94afc9b2-ac34-ccff-88ae-297ab3c7ff34" and Where="/home/user1/My Documents".
A. Rename the mount file to home-user1-My\x20Documents.mount. E. Change the Where entry to Where=/home/user1/My\x20Documents.
Explanation
The mount unit file name and the Where entry must be escaped to handle spaces in the path.ReferencesThe mount unit file name must be named after the mount point directory, with spaces replaced by \x20. See How to escape spaces in systemd unit files? and systemd.mount.The Where entry must use \x20 to escape spaces in the path. See systemd.mount and The workaround is to use /usr/bin/env followed by the path in quotes..
Question 350:
A systems technician is configuring an application server to accept packets from a trusted source with the IP address 192.168.10.22. Which of the following commands will allow communication between the two servers?
A. iptables -L -s 192.168.10.22 -j ACCEPT B. iptables -D INPUT -s 192.168.10.22 -j ACCEPT C. iptables -A INPUT -s 192.168.10.22 -j ACCEPT D. iptables -A OUTPUT -S 192.168.10.22 -j ACCEPT
C. iptables -A INPUT -s 192.168.10.22 -j ACCEPT
Explanation
The iptables command is used to configure firewall rules in Linux.To allow packets from a specific source (192.168.10.22) to the server, we must append a rule to the INPUT chain:
iptables -A INPUT -s 192.168.10.22 -j ACCEPT
Explanation of the command:
Why the other options are incorrect?
Persisting the Rule:
To make the rule persistent after a reboot, it must be saved:
Nowadays, the certification exams become more and more important and required by more and more
enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare
for the exam in a short time with less efforts? How to get a ideal result and how to find the
most reliable resources? Here on Vcedump.com, you will find all the answers.
Vcedump.com provide not only CompTIA exam questions,
answers and explanations but also complete assistance on your exam preparation and certification
application. If you are confused on your XK0-005 exam preparations
and CompTIA certification application, do not hesitate to visit our
Vcedump.com to find your solutions here.