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

Prepare Strategically for the CompTIA Linux+ Exam with XK0-005 Practice Tests

To thoroughly prepare for the CompTIA Linux+ XK0-005 exam, it's essential to utilize various exam resources and study materials. One effective approach is to practice with mock exams or test questions that closely resemble the actual exam format and content. These exam questions and answers can help you identify areas where you need further study and reinforce your understanding of key concepts. Additionally, exam preparation guides and study resources from reputable sources can provide in-depth explanations, practical examples, and tips to help you pass the exam successfully. Regularly reviewing these materials and practicing with mock exams can boost your confidence and increase your chances of achieving a passing score on the CompTIA Linux+ XK0-005 certification exam.
Take other online exams

Question #1
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. dmidecode -s system-version
B. lscpu
C. sysctl -a
D. cat /sys/device/system/cpu/possible
View answer
Correct Answer: B
Question #2
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. chmod +t /project/access2all
B. chmod +rws /project/access2all
C. chmod 2770 /project/access2all
D. chmod ugo+rwx /project/access2all
View answer
Correct Answer: A
Question #3
An administrator needs to make some changes in the IaC declaration templates. Which of the following commands would maintain version control?
A. it clone https://github
B. it clone https://qithub
C. it clone https://github
D. it clone https://github
View answer
Correct Answer: D
Question #4
Several users reported that they were unable to write data to the /oracle1 directory. The following output has been provided: Which of the following commands should the administrator use to diagnose the issue?
A. f -i /oracle1
B. disk -1 /dev/sdb1
C. sblk /dev/sdb1
D. u -sh /oracle1
View answer
Correct Answer: A
Question #5
A Linux administrator has installed a web server, a database server, and a web application on a server. The web application should be active in order to render the web pages. After the administrator restarts the server, the website displays the following message in the browser: Error establishing a database connection. The Linux administrator reviews the following relevant output from the systemd init files: The administrator needs to ensure that the database is available before the web application is start
A. RIGGERS=mariadb
B. NFAILURE=mariadb
C. ANTEDBY=mariadb
D. EQUIRES=mariadb
View answer
Correct Answer: D
Question #6
A new Linux systems administrator just generated a pair of SSH keys that should allow connection to the servers. Which of the following commands can be used to copy a key file to remote servers? (Choose two.)
A. cho 1 > /proc/sys/net/ipv4/ipv_forward
B. ysctl -w net
C. irewall-cmd --enable ipv4_forwarding
D. ystemctl start ipv4_forwarding
View answer
Correct Answer: DF
Question #7
A Linux administrator is creating a primary partition on the replacement hard drive for an application server. Which of the following commands should the administrator issue to verify the device name of this partition?
A. udo fdisk /dev/sda
B. udo fdisk -s /dev/sda
C. udo fdisk -l
D. udo fdisk -h
View answer
Correct Answer: C
Question #8
A Linux administrator is troubleshooting the root cause of a high CPU load and average. Which of the following commands will permanently resolve the issue?
A. enice -n -20 6295
B. stree -p 6295
C. ostat -cy 1 5
D. ill -9 6295
View answer
Correct Answer: A
Question #9
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 #10
A systems administrator requires that all files that are created by the user named web have read-only permissions by the owner. Which of the following commands will satisfy this requirement?
A. hown web:web /home/web
B. hmod -R 400 /home/web
C. cho "umask 377" >> /home/web/
D. etfacl read /home/web
View answer
Correct Answer: B
Question #11
A Linux administrator is tasked with creating resources using containerization. When deciding how to create this type of deployment, the administrator identifies some key features, including portability, high availability, and scalability in production. Which of the following should the Linux administrator choose for the new design?
A. ocker
B. n-premises systems
C. loud-based systems
D. ubernetes
View answer
Correct Answer: D
Question #12
A systems administrator wants to test the route between IP address 10.0.2.15 and IP address 192.168.1.40. Which of the following commands will accomplish this task?
A. oute -e get to 192
B. p route get 192
C. p route 192
D. oute -n 192
View answer
Correct Answer: B
Question #13
A cloud engineer is installing packages during VM provisioning. Which of the following should the engineer use to accomplish this task?
A. loud-init
B. ash
C. ocker
D. idecar
View answer
Correct Answer: A
Question #14
A systems administrator is implementing a new service task with systems at startup and needs to execute a script entitled test.sh with the following content: The administrator tries to run the script after making it executable with chmod +x; however, the script will not run. Which of the following should the administrator do to address this issue? (Choose two.)
A. hmod 755 filename
B. hmod 640 filename
C. hmod 740 filename
D. hmod 744 filename
View answer
Correct Answer: BC
Question #15
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 #16
Users report that connections to a MariaDB service are being closed unexpectedly. A systems administrator troubleshoots the issue and finds the following message in /var/log/messages: Which of the following is causing the connection issue?
A. he process mysqld is using too many semaphores
B. he server is running out of file descriptors
C. omething is starving the server resources
D. he amount of RAM allocated to the server is too high
View answer
Correct Answer: A
Question #17
A developer is trying to install an application remotely that requires a graphical interface for installation. The developer requested assistance to set up the necessary environment variables along with X11 forwarding in SSH. Which of the following environment variables must be set in remote shell in order to launch the graphical interface?
A. RHOST
B. ETENV
C. SHELL
D. DISPLAY
View answer
Correct Answer: D
Question #18
A Linux administrator needs to resolve a service that has failed to start. The administrator runs the following command: The following output is returned Which of the following is MOST likely the issue?
A. he service does not have permissions to read write the startupfile
B. he service startupfile size cannot be 81k
C. he service startupfile cannot be owned by root
D. he service startupfile should not be owned by the root group
View answer
Correct Answer: A
Question #19
An administrator deployed a Linux server that is running a web application on port 6379/tcp.-SELinux is in enforcing mode based on organization policies.-The port is open on the firewall.-Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.The administrator ran some commands that resulted in the following output:Which of the following commands should be used to resolve the issue?
A. emanage port -d -t http_port_t -p tcp 6379
B. emanage port -a -t http_port_t -p tcp 6379
C. emanage port -a http_port_t -p top 6379
D. emanage port -l -t http_port_tcp 6379
View answer
Correct Answer: B
Question #20
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. source ~/
B. read ~/
C. touch ~/
D. echo ~/
View answer
Correct Answer: A
Question #21
DRAG DROP (Drag and Drop is not supported.)As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following: Add relevant content to /tmp/script.sh, so that it finds and compresses related files in /var/log without recursion.INSTRUCTIONS:Drag and drop snippets to fill the blanks to build a script that performs the actual compression of rotated log files.If at any time you would like to bring back the initial state of the simulation, please click the Reset Al
A. ee Explanation section for answer
View answer
Correct Answer: A
Question #22
A Linux administrator was tasked with deleting all files and directories with names that are contained in the sobelete.txt file. Which of the following commands will accomplish this task?
A. args -f cat toDelete
B. m -d -r -f toDelete
C. at toDelete
D. at toDelete
View answer
Correct Answer: B
Question #23
Which of the following is a function of a bootloader?
A. t initializes all the devices that are required to load the OS
B. t mounts the root filesystem that is required to load the OS
C. t helps to load the different kernels to initiate the OS startup process
D. t triggers the start of all the system services
View answer
Correct Answer: A
Question #24
A Linux administrator is scheduling a system job that runs a script to check available disk space every hour. The Linux administrator does not want users to be able to start the job. Given the following: The Linux administrator attempts to start the timer service but receives the following error message: Which of the following is MOST likely the reason the timer will not start?
A. he checkdiskspace
B. he timers
C. he checkdiskspace
D. he checkdiskspace
View answer
Correct Answer: C
Question #25
A systems administrator is tasked with preventing logins from accounts other than root, while the file /etc/nologin exists. Which of the following PAM modules will accomplish this task?
A. am_login
B. am_access
C. am_logindef
D. am_nologin
View answer
Correct Answer: D
Question #26
A Linux engineer has been notified about the possible deletion of logs from the file /opt/app/logs. The engineer needs to ensure the log file can only be written into without removing previous entries. Which of the following commands would be BEST to use to accomplish this task?
A. hattr +a /opt/app/logs
B. hattr +d /opt/app/logs
C. hattr +i /opt/app/logs
D. hattr +c /opt/app/logs
View answer
Correct Answer: A
Question #27
A Linux administrator needs to correct the permissions of a log file on the server. Which of the following commands should be used to set filename.log permissions to -rwxr—r--. ?
A. hgrp system accountname
B. asswd –s accountname
C. hmod -G system account name
D. hage -E -1 accountname
View answer
Correct Answer: D
Question #28
A systems administrator needs to check if the service systemd-resolved.service is running without any errors. Which of the following commands will show this information?
A. ystemctl status systemd-resolved
B. ystemctl enable systemd-resolved
C. ystemctl mask systemd-resolved
D. ystemctl show systemd-resolved
View answer
Correct Answer: A
Question #29
Which of the following technologies can be used as a central repository of Linux users and groups?
A. DAP
B. FA
C. SO
D. AM
View answer
Correct Answer: A
Question #30
A Linux administrator wants to set the SUID of a file named dev_team.text with 744 access rights. Which of the following commands will achieve this goal?
A. hmod 4744 dev_team
B. hmod 744 --setuid dev_team
C. hmod -c 744 dev_team
D. hmod -v 4744 --suid dev_team
View answer
Correct Answer: A
Question #31
When trying to log in remotely to a server, a user receives the following message: The server administrator is investigating the issue on the server and receives the following outputs: Which of the following is causing the issue?
A. he wrong permissions are on the user’s home directory
B. he account was locked out due to three failed logins
C. he user entered the wrong password
D. he user has the wrong shell assigned to the account
View answer
Correct Answer: D
Question #32
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. ls | cpio -iv > cloud
B. ls | cpio -iv < cloud
C. ls | cpio -ov > cloud
D. ls cpio -ov < cloud
View answer
Correct Answer: C
Question #33
A systems administrator has been tasked with disabling the nginx service from the environment to prevent it from being automatically and manually started. Which of the following commands will accomplish this task?
A. ystemctl cancel nginx
B. ystemctl disable nginx
C. ystemctl mask nginx
D. ystemctl stop nginx
View answer
Correct Answer: C
Question #34
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. The administrator did not reboot the server properly
B. The administrator did not set the default target to basic
C. The administrator did not set the default target to graphical
D. The administrator did not shut down the server properly
View answer
Correct Answer: C
Question #35
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. find /var/log -type d -mtime +180 -print -exec rm {} \;
B. find /var/log -type f -modified +180 -rm
C. find /var/log -type f -mtime +180 -exec rm {} \
D. find /var/log -type c -atime +180 –remove
View answer
Correct Answer: A
Question #36
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 #37
Developers have requested implementation of a persistent, static route on the application server. Packets sent over the interface eth0 to 10.0.213.5/32 should be routed via 10.0.5.1. Which of the following commands should the administrator run to achieve this goal?
A. oute -i etho -p add 10
B. oute modify eth0 +ipv4
C. cho "10
D. p route add 10
View answer
Correct Answer: D
Question #38
Which of the following files holds the system configuration for journal when running systemd?
A. etc/systemd/journald
B. etc/systemd/systemd-journalctl
C. usr/lib/systemd/journalctl
D. etc/systemd/systemd-journald
View answer
Correct Answer: A
Question #39
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 #40
An administrator transferred a key for SSH authentication to a home directory on a remote server. The key file was moved to .ssh/authorized_keys location in order to establish SSH connection without a password. However, the SSH command still asked for the password. Given the following output: Which of the following commands would resolve the issue?
A. estorecon
B. sh_keygen -t rsa -o
C. hown root:root
D. hmod 600
View answer
Correct Answer: A
Question #41
Developers have requested implementation of a persistent, static route on the application server. Packets sent over the interface eth0 to 10.0.213.5/32 should be routed via 10.0.5.1. Which of the following commands should the administrator run to achieve this goal?
A. oute -i etho -p add 10
B. oute modify eth0 +ipv4
C. cho "10
D. p route add 10
View answer
Correct Answer: D
Question #42
A systems administrator needs to clone the partition /dev/sdc1 to /dev/sdd1. Which of the following commands will accomplish this task?
A. ar -cvzf /dev/sdd1 /dev/sdc1
B. sync /dev/sdc1 /dev/sdd1
C. d if=/dev/sdc1 of=/dev/sdd1
D. cp /dev/sdc1 /dev/sdd1
View answer
Correct Answer: C
Question #43
After installing some RPM packages, a systems administrator discovers the last package that was installed was not needed. Which of the following commands can be used to remove the package?
A. nf remove packagename
B. pt-get remove packagename
C. pm -i packagename
D. pt remove packagename
View answer
Correct Answer: A
Question #44
A Linux administrator wants to find out whether files from the wget package have been altered since they were installed. Which of the following commands will provide the correct information?
A. pm -i wget
B. pm -qf wget
C. pm -F wget
D. pm -V wget
View answer
Correct Answer: D
Question #45
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. mount disk by device-id
B. fsck -A
C. mount disk by-label
D. mount disk by-blkid
View answer
Correct Answer: D
Question #46
Based on an organization’s new cybersecurity policies, an administrator has been instructed to ensure that, by default, all new users and groups that are created fall within the specified values below. To which of the following configuration files will the required changes need to be made?
A. etc/login
B. etc/security/limits
C. etc/default/useradd
D. etc/profile
View answer
Correct Answer: C
Question #47
A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?
A. odman run -d -p 443:8443 httpd
B. odman run -d -p 8443:443 httpd
C. odman run –d -e 443:8443 httpd
D. odman exec -p 8443:443 httpd
View answer
Correct Answer: A
Question #48
A systems administrator wants to back up the directory /data and all its contents to /backup/data on a remote server named remote. Which of the following commands will achieve the desired effect?
A. cp -p /data remote:/backup/data
B. sh -i /remote:/backup/ /data
C. sync -a /data remote:/backup/
D. p -r /data /remote/backup/
View answer
Correct Answer: C
Question #49
A Linux administrator created a new file system. Which of the following files must be updated to ensure the filesystem mounts at boot time?
A. etc/sysctl
B. etc/filesystems
C. etc/fstab
D. etc/nfsmount
View answer
Correct Answer: C
Question #50
A systems administrator is deploying three identical, cloud-based servers. The administrator is using the following code to complete the task: Which of the following technologies is the administrator using?
A. nsible
B. uppet
C. hef
D. erraform
View answer
Correct Answer: D
Question #51
A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?
A. ocker run -ti app /bin/sh
B. odman exec -ti app /bin/sh
C. odman run -d app /bin/bash
D. ocker exec -d app /bin/bash
View answer
Correct Answer: B
Question #52
A Linux administrator needs to resolve a service that has failed to start. The administrator runs the following command:The following output is returnedWhich of the following is MOST likely the issue?
A. The service does not have permissions to read write the startupfile
B. The service startupfile size cannot be 81k
C. The service startupfile cannot be owned by root
D. The service startupfile should not be owned by the root group
View answer
Correct Answer: A

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: