DON'T WANT TO MISS A THING?

Certification Exam Passing Tips

Latest exam news and discount info

Curated and up-to-date by our experts

Yes, send me the newsletter

Latest CompTIA Linux+ XK0-005 Exam Questions for Effective Preparation

When preparing for the CompTIA Linux+ XK0-005 exam, it's crucial to access high-quality exam resources and study materials. Reputable online platforms and publishers offer a wide range of exam questions and answers, test questions, and mock exams that can help you gauge your readiness and identify areas that need further attention. These exam preparation resources often include detailed explanations for each question, allowing you to understand the reasoning behind correct and incorrect answers. Additionally, comprehensive study guides and practice labs can provide hands-on experience with Linux systems, reinforcing the practical skills assessed in the exam. By utilizing a combination of exam questions, study materials, and practical exercises, you can increase your chances of passing the CompTIA Linux+ XK0-005 certification exam successfully on your first attempt.
Take other online exams

Question #1
A user is asking the systems administrator for assistance with writing a script to verify whether a file exists. Given the following: Which of the following commands should replace the string?
A. f [ -f "$filename" ]; then
B. f [ -d "$filename" ]; then
C. f [ -f "$filename" ] then
D. f [ -f "$filename" ]; while
View answer
Correct Answer: A
Question #2
A systems administrator wants to be sure the sudo rules just added to /etc/sudoers are valid. Which of the following commands can be used for this task?
A. isudo -c
B. est -f /etc/sudoers
C. udo vi check
D. at /etc/sudoers | tee test
View answer
Correct Answer: A
Question #3
A Linux administrator booted up the server and was presented with a non-GUI terminal. The administrator ran the command systemctl isolate graphical.target and rebooted the system by running systemctl reboot, which fixed the issue. However, the next day the administrator was presented again with a non-GUI terminal. Which of the following is the issue?
A. he administrator did not reboot the server properly
B. he administrator did not set the default target to basic
C. he administrator did not set the default target to graphical
D. he administrator did not shut down the server properly
View answer
Correct Answer: C
Question #4
A Linux engineer set up two local DNS servers (10.10.10.10 and 10.10.10.20) and was testing email connectivity to the local mail server using the mail command on a local machine when the following error appeared: The local machine DNS settings are: Which of the following commands could the engineer use to query the DNS server to get mail server information?
A. ig @example
B. ig @10
C. ig @example
D. ig @10
View answer
Correct Answer: B
Question #5
A systems administrator is tasked with installing GRUB on the legacy MBR of the SATA hard drive. Which of the following commands will help the administrator accomplish this task?
A. rub-install /dev/hda
B. rub-install /dev/sda
C. rub-install /dev/sr0
D. rub-install /dev/hd0,0
View answer
Correct Answer: B
Question #6
A new file was added to a main Git repository. An administrator wants to synchronize a local copy with the contents of the main repository. Which of the following commands should the administrator use for this task?
A. it reflog
B. it pull
C. it status
D. it push
View answer
Correct Answer: B
Question #7
A systems administrator is checking the system logs. The administrator wants to look at the last 20 lines of a log. Which of the following will execute the command?
A. ail -v 20
B. ail -n 20
C. ail -c 20
D. ail -l 20
View answer
Correct Answer: B
Question #8
A Linux engineer is setting the sticky bit on a directory called devops with 755 file permission. Which of the following commands will accomplish this task?
A. hown -s 755 devops
B. hown 1755 devops
C. hmod -s 755 devops
D. hmod 1755 devops
View answer
Correct Answer: D
Question #9
A user generated a pair of private-public keys on a workstation. Which of the following commands will allow the user to upload the public key to a remote server and enable passwordless login?
A. cp ~/
B. sync ~ /
C. sh-add user server
D. sh-copy-id user@server
View answer
Correct Answer: D
Question #10
A Linux administrator created the directory /project/access2all. By creating this directory, the administrator is trying to avoid the deletion or modification of files from non-owners. Which of the following will accomplish this goal?
A. hmod +t /project/access2all
B. hmod +rws /project/access2all
C. hmod 2770 /project/access2all
D. hmod ugo+rwx /project/access2all
View answer
Correct Answer: A
Question #11
A systems administrator made some unapproved changes prior to leaving the company. The newly hired administrator has been tasked with revealing the system to a compliant state. Which of the following commands will list and remove the correspondent packages?
A. nf list and dnf remove last
B. nf remove and dnf check
C. nf info and dnf upgrade
D. nf history and dnf history undo last
View answer
Correct Answer: D
Question #12
A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?
A. he checkdiskspace
B. he checkdiskspace
C. he OnCalendar schedule is incorrect in the timer definition
D. he system-daemon services need to be reloaded
View answer
Correct Answer: D
Question #13
A Linux systems administrator is setting up a new web server and getting 404 - NOT FOUND errors while trying to access the web server pages from the browser. While working on the diagnosis of this issue, the Linux systems administrator executes the following commands:Which of the following commands will BEST resolve this issue?
A. ed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
B. estorecon -R -v /var/www/html
C. etenforce 0
D. etsebool -P httpd_can_network_connect_db on
View answer
Correct Answer: B
Question #14
A Linux administrator is troubleshooting an issue in which an application service failed to start on a Linux server. The administrator runs a few commands and gets the following outputs: Based on the above outputs, which of the following is the MOST likely action the administrator should take to resolve this issue?
A. nable the logsearch
B. ncrease the TimeoutStartUSec configuration for the logsearch
C. pdate the OnCalendar configuration to schedule the start of the logsearch
D. pdate the KillSignal configuration for the logsearch
View answer
Correct Answer: B
Question #15
A cloud engineer needs to remove all dangling images and delete all the images that do not have an associated container. Which of the following commands will help to accomplish this task?
A. ocker images prune -a
B. ocker push images -a
C. ocker rmi -a images
D. ocker images rmi --all
View answer
Correct Answer: A
Question #16
A systems administrator configured firewall rules using firewalld. However, after the system is rebooted, the firewall rules are not present: The systems administrator makes additional checks: Which of the following is the reason the firewall rules are not active?
A. ptables is conflicting with firewalld
B. he wrong system target is activated
C. IREWALL_ARGS has no value assigned
D. he firewalld service is not enabled
View answer
Correct Answer: D
Question #17
A systems administrator made some changes in the ~/.bashrc file and added an alias command. When the administrator tried to use the alias command, it did not work. Which of the following should be executed FIRST?
A. ource ~/
B. ead ~/
C. ouch ~/
D. cho ~/
View answer
Correct Answer: A
Question #18
A systems administrator installed a new software program on a Linux server. When the systems administrator tries to run the program, the following message appears on the screen. Which of the following commands will allow the systems administrator to check whether the system supports virtualization?
A. midecode -s system-version
B. scpu
C. ysctl -a
D. at /sys/device/system/cpu/possible
View answer
Correct Answer: B
Question #19
To harden one of the servers, an administrator needs to remove the possibility of remote administrative login via the SSH service. Which of the following should the administrator do?
A. dd the line DenyUsers root to the /etc/hosts
B. et PermitRootLogin to no in the /etc/ssh/sshd_config file
C. dd the line account required pam_nologin
D. et PubKeyAuthentication to no in the /etc/ssh/ssh_config file
View answer
Correct Answer: B
Question #20
An administrator accidentally deleted the /boot/vmlinuz file and must resolve the issue before the server is rebooted. Which of the following commands should the administrator use to identify the correct version of this file?
A. pm -qa | grep kernel; uname -a
B. um -y update; shutdown -r now
C. at /etc/centos-release; rpm -Uvh --nodeps
D. elinit 1; restorecon -Rv /boot
View answer
Correct Answer: A
Question #21
Which of the following commands will display the operating system?
A. name -n
B. name -s
C. name -o
D. name -m
View answer
Correct Answer: C
Question #22
A Linux system fails to start and delivers the following error message: Which of the following commands can be used to address this issue?
A. sck
B. artprobe /dev/sda1
C. disk /dev/sda1
D. kfs
View answer
Correct Answer: A
Question #23
A systems administrator created a web server for the company and is required to add a tag for the API so end users can connect. Which of the following would the administrator do to complete this requirement?
A. ostnamectl status --no-ask-password
B. ostnamectl set-hostname "$(perl -le "print" "A" x 86)"
C. ostnamectl set-hostname Comptia-WebNode -H root@192
D. ostnamectl set-hostname Comptia-WebNode --transient
View answer
Correct Answer: C
Question #24
A Linux administrator needs to ensure that Java 7 and Java 8 are both locally available for developers to use when deploying containers. Currently only Java 8 is available. Which of the following commands should the administrator run to ensure both versions are available?
A. ocker image load java:7
B. ocker image pull java:7
C. ocker image import java:7
D. ocker image build java:7
View answer
Correct Answer: B
Question #25
A Linux administrator needs to remove software from the server. Which of the following RPM options should be used?
A. pm -s
B. рm -d
C. pm -q
D. pm -e
View answer
Correct Answer: D
Question #26
A Linux administrator is troubleshooting SSH connection issues from one of the workstations.When users attempt to log in from the workstation to a server with the IP address 104.21.75.76, they receive the following message: The administrator reviews the information below: Which of the following is causing the connectivity issue?
A. he workstation has the wrong IP settings
B. he sshd service is disabled
C. he server’s firewall is preventing connections from being made
D. he server has an incorrect default gateway configuration
View answer
Correct Answer: B
Question #27
A Linux administrator cloned an existing Linux server and built a new server from that clone. The administrator encountered the following error after booting the cloned server:The administrator performed the commands listed below to further troubleshoot and mount the missing filesystem:Which of the following should administrator use to resolve the device mismatch issue and mount the disk?
A. ount disk by device-id
B. sck -A
C. ount disk by-label
D. ount disk by-blkid
View answer
Correct Answer: D
Question #28
A systems administrator is tasked with creating a cloud-based server with a public IP address. The code is as follows: Which of the following technologies did the systems administrator use to complete this task?
A. uppet
B. it
C. nsible
D. erraform
View answer
Correct Answer: D
Question #29
A junior systems administrator has just generated public and private authentication keys for passwordless login. Which of the following files will be moved to the remote servers?
A. d_dsa
B. d_rsa
C. d_ecdsa
D. d_rsa
View answer
Correct Answer: D
Question #30
A systems administrator is troubleshooting connectivity issues and trying to find out why a Linux server is not able to reach other servers on the same subnet it is connected to. When listing link parameters, the following is presented:Based on the output above, which of following is the MOST probable cause of the issue?
A. he address ac:00:11:22:33:cd is not a valid Ethernet address
B. he Ethernet broadcast address should be ac:00:11:22:33:ff instead
C. he network interface eth0 is using an old kernel module
D. he network interface cable is not connected to a switch
View answer
Correct Answer: D
Question #31
A Linux administrator is troubleshooting a memory-related issue. Based on the output of the commands: Which of the following commands would address the issue?
A. op -p 8321
B. ill -9 8321
C. enice -10 8321
D. ree 8321
View answer
Correct Answer: C
Question #32
A cloud engineer needs to change the secure remote login port from 22 to 49000. Which of the following files should the engineer modify to change the port number to the desired value?
A. etc/host
B. etc/hostname
C. etc/services
D. etc/ssh/sshd_config
View answer
Correct Answer: D
Question #33
A Linux engineer is setting the sticky bit on a directory called devops with 755 file permission. Which of the following commands will accomplish this task?
A. chown -s 755 devops
B. chown 1755 devops
C. chmod -s 755 devops
D. chmod 1755 devops
View answer
Correct Answer: D
Question #34
Which of the following tools is commonly used for creating CI/CD pipelines?
A. hef
B. uppet
C. enkins
D. nsible
View answer
Correct Answer: C
Question #35
SIMULATIONJunior system administrator had trouble installing and running an Apache web server on a Linux server. You have been tasked with installing the Apache web server on the Linux server and resolving the issue that prevented the junior administrator from running Apache.INSTRUCTIONS::Install Apache and start the service. Verify that the Apache service is running with the defaults. Typing “help” in the terminal will show a list of relevant event commands.If at any time you would like to bring back the i
A. ee the explanation below
View answer
Correct Answer: A
Question #36
A systems administrator is investigating why one of the servers has stopped connecting to the internet.Which of the following is causing the issue?
A. he DNS address has been commented out in the configuration file
B. he search entry in the /etc/resolv
C. ired connection 1 is offline
D. o default route is defined
View answer
Correct Answer: A
Question #37
An administrator attempts to rename a file on a server but receives the following error. The administrator then runs a few commands and obtains the following output: Which of the following commands should the administrator run NEXT to allow the file to be renamed by any user?
A. hgrp reet files
B. hacl -R 644 files
C. hown users files
D. hmod -t files
View answer
Correct Answer: D
Question #38
A Linux systems administrator needs to persistently enable IPv4 forwarding in one of the Linux systems. Which of the following commands can be used together to accomplish this task? (Choose two.)
A. sysctl net
B. sysctl -w net
C. echo "net
D. echo 1 > /proc/sys/net/ipv4/ip_forward
E. sysctl –p
F. echo "net
View answer
Correct Answer: BC
Question #39
Due to low disk space, a Linux administrator finding and removing all log files that were modified more than 180 days ago. Which of the following commands will accomplish this task?
A. ind /var/log -type d -mtime +180 -print -exec rm {} \\;
B. ind /var/log -type f -modified +180 -rm
C. ind /var/log -type f -mtime +180 -exec rm {} \\
D. ind /var/log -type c -atime +180 –remove
View answer
Correct Answer: A
Question #40
A junior administrator is trying to set up a passwordless SSH connection to one of the servers. The administrator follows the instructions and puts the key in the authorized_key file at the server, but the administrator is still asked to provide a password during the connection.Given the following output:Which of the following commands would resolve the issue and allow an SSH connection to be established without a password?
A. restorecon -rv
B. mv
C. systemctl restart sshd
D. chmod 600 mv
View answer
Correct Answer: B
Question #41
A Linux administrator needs to create a new cloud.cpio archive containing all the files from the current directory. Which of the following commands can help to accomplish this task?
A. s | cpio -iv > cloud
B. s | cpio -iv < cloud
C. s | cpio -ov > cloud
D. s cpio -ov < cloud
View answer
Correct Answer: D
Question #42
A developer has been unable to remove a particular data folder that a team no longer uses. The developer escalated the issue to the systems administrator. The following output was received: Which of the following commands can be used to resolve this issue?
A. hgrp -R 755 data/
B. hmod -R 777 data/
C. hattr -R -i data/
D. hown -R data/
View answer
Correct Answer: C
Question #43
An administrator is trying to diagnose a performance issue and is reviewing the following output: System Properties:-CPU: 4 vCPU-Memory: 40GB-Disk maximum IOPS: 690-Disk maximum throughput: 44Mbps | 44000KbpsBased on the above output, which of the following BEST describes the root cause?
A. he system has reached its maximum IOPS, causing the system to be slow
B. he system has reached its maximum permitted throughput, therefore iowait is increasing
C. he system is mostly idle, therefore the iowait is high
D. he system has a partitioned disk, which causes the IOPS to be doubled
View answer
Correct Answer: B
Question #44
A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128. Which of the following commands will accomplish this task?
A. ptables -t nat -D PREROUTING -p tcp --sport 80 -j DNAT - -to-destination 192
B. ptables -t nat -A PREROUTING -p top --dport 81 -j DNAT –-to-destination 192
C. ptables -t nat -I PREROUTING -p top --sport 80 -j DNAT –-to-destination 192
D. ptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT –-to-destination 192
View answer
Correct Answer: D
Question #45
A Linux administrator needs to create an image named sda.img from the sda disk and store it in the /tmp directory. Which of the following commands should be used to accomplish this task?
A. d of=/dev/sda if=/tmp/sda
B. d if=/dev/sda of=/tmp/sda
C. d --if=/dev/sda --of=/tmp/sda
D. d --of=/dev/sda --if=/tmp/sda
View answer
Correct Answer: B
Question #46
A newly created container has been unable to start properly, and a Linux administrator is analyzing the cause of the failure. Which of the following will allow the administrator to determine the FIRST command that is executed inside the container right after it starts?
A. ocker export
B. ocker info
C. ocker start
D. ocker inspect
View answer
Correct Answer: D
Question #47
A Linux administrator is trying to remove the ACL from the file /home/user/data. txt but receives the following error message: Given the following analysis: Which of the following is causing the error message?
A. he administrator is not using a highly privileged account
B. he filesystem is mounted with the wrong options
C. ELinux file context is denying the ACL changes
D. ile attributes are preventing file modification
View answer
Correct Answer: D
Question #48
A junior administrator is trying to set up a passwordless SSH connection to one of the servers. The administrator follows the instructions and puts the key in the authorized_key file at the server, but the administrator is still asked to provide a password during the connection.Given the following output: Which of the following commands would resolve the issue and allow an SSH connection to be established without a password?
A. estorecon -rv
B. v
C. ystemctl restart sshd
D. hmod 600 mv
View answer
Correct Answer: B
Question #49
A Linux administrator is trying to remove the ACL from the file /home/user/data. txt but receives the following error message:Given the following analysis:Which of the following is causing the error message?
A. The administrator is not using a highly privileged account
B. The filesystem is mounted with the wrong options
C. SELinux file context is denying the ACL changes
D. File attributes are preventing file modification
View answer
Correct Answer: D
Question #50
A junior systems administrator has just generated public and private authentication keys for passwordless login. Which of the following files will be moved to the remote servers?
A. id_dsa
B. id_rsa
C. id_ecdsa
D. id_rsa
View answer
Correct Answer: D
Question #51
A Linux administrator recently downloaded a software package that is currently in a compressed file. Which of the following commands will extract the files?
A. nzip -v
B. zip2 -z
C. zip
D. unzip
View answer
Correct Answer: C

View Answers after Submission

Please submit your email and WhatsApp to get the answers of questions.

Note: Please make sure your email ID and Whatsapp are valid so that you can get the correct exam results.

Email:
Whatsapp/phone number: