comptia xk0-005 practice test

Exam Title: CompTIA Linux+

Last update: Dec 15 ,2025
Question 1

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
Answer:

a

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
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
Answer:

a

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 3

A systems administrator needs to clone the partition /dev/sdc1 to /dev/sdd1. Which of the following commands will accomplish this task?

  • A. tar -cvzf /dev/sdd1 /dev/sdc1
  • B. rsync /dev/sdc1 /dev/sdd1
  • C. dd if=/dev/sdc1 of=/dev/sdd1
  • D. scp /dev/sdc1 /dev/sdd1
Answer:

c

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 4

After listing the properties of a system account, a systems administrator wants to remove the expiration date of a user account. Which of the following commands will accomplish this task?

  • A. chgrp system accountname
  • B. passwd s accountname
  • C. chmod -G system account name
  • D. chage -E -1 accountname
Answer:

d

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 5

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.
Answer:

d

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 6

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. Add #!/bin/bash to the bottom of the script.
  • B. Create a unit file for the new service in /etc/systemd/system/ with the name helpme.service in the location.
  • C. Add #!//bin/bash to the top of the script.
  • D. Restart the computer to enable the new service.
  • E. Create a unit file for the new service in /etc/init.d with the name helpme.service in the location.
  • F. Shut down the computer to enable the new service.
Answer:

bc

vote your answer:
A
B
C
D
E
F
A 0 B 0 C 0 D 0 E 0 F 0
Comments
Question 7

A Linux administrator has been tasked with installing the most recent versions of packages on a RPM-based OS. Which of the following commands will accomplish this task?

  • A. apt-get upgrade
  • B. rpm -a
  • C. yum updateinfo
  • D. dnf update
  • E. yum check-update
Answer:

d

vote your answer:
A
B
C
D
E
A 0 B 0 C 0 D 0 E 0
Comments
Question 8

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
Answer:

d

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 9

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. docker export
  • B. docker info
  • C. docker start
  • D. docker inspect
Answer:

d

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Question 10

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 started. Which of the following should the administrator add to the HTTP server .service file to accomplish this task?

  • A. TRIGGERS=mariadb.service
  • B. ONFAILURE=mariadb.service
  • C. WANTEDBY=mariadb.service
  • D. REQUIRES=mariadb.service
Answer:

d

vote your answer:
A
B
C
D
A 0 B 0 C 0 D 0
Comments
Page 1 out of 18
Viewing questions 1-10 out of 187
Go To
page 2