CompTIA Study Materials
AWS Study Materials
AWS Cloud Practitioner AWS Cloud Practitioner
AWS Cloud Practitioner CLF-C02
Microsoft Study Materials
Microsoft Azure Fundamentals Microsoft Azure Fundamentals
Microsoft Azure Fundamentals AZ-900
00:15:00

Free CompTIA Linux+ XK0-005 Practice Test

Prepare for the CompTIA Linux+ XK0-005 exam with our free practice test. Randomly generated and customizable, this test allows you to choose the number of questions.

  • Questions: 15
  • Time: 15 minutes (60 seconds per question)
  • Included Objectives:
    • Scripting, Containers, and Automation
    • System Management
    • Security
    • Troubleshooting
Question 1 of 15

An administrator in your organization is concerned about performance issues and believes that Security-Enhanced Linux (SELinux) may be impacting the system's performance negatively. The admin has decided to completely disable SELinux to test this theory. After changing the SELinux mode to 'disabled' and rebooting the system, what long-term security implications should the administrator be made aware of?

  • The system will rely solely on traditional Unix/Linux permissions, leading to potential security vulnerabilities.

  • SELinux can be re-enabled without rebooting, thus no long-term security implications exist.

  • SELinux will automatically re-enable after an update, minimizing long-term security risks.

  • The system performance will improve without any negative security implications since file permissions and ACLs continue to protect the system.

Question 2 of 15

Which lvchange option is used to prevent allocation of physical extents to a logical volume?

  • -r or --resizefs

  • -a n or --alloc none

  • -l +100%FREE

  • -an or --activate no

Question 3 of 15

A Linux administrator needs to grant a user named 'jane' write access to a file called 'data.log', which is currently only accessible by its owner 'john'. The file should not have its existing permissions altered for any other user or group. Which of the following commands would correctly grant 'jane' the required access?

  • chmod +w data.log

  • chown jane data.log

  • setfacl -m u:jane:rwx data.log

  • setfacl -m o:w data.log

  • chmod u+w data.log

  • setfacl -m u:jane:w data.log

Question 4 of 15

You are maintaining a script that updates system packages and restarts a critical service afterward, but only if the update succeeds. Which line of code correctly implements this behavior?

  • yum update -y & service httpd restart

  • yum update -y ; service httpd restart

  • yum update -y && service httpd restart

  • yum update -y || service httpd restart

Question 5 of 15

A system administrator needs to create a compressed backup of the /var/log directory. Which command should they use to create a gzip-compressed archive file named log_backup.tar.gz?

  • tar -cvf log_backup.tar.gz /var/log

  • tar -xvf log_backup.tar.gz /var/log

  • tar -tzvf log_backup.tar.gz /var/log

  • tar -czvf log_backup.tar.gz /var/log

Question 6 of 15

A system administrator needs to find occurrences of the word 'refused' in the 'auth.log' file, which indicates failed SSH login attempts, and then count how many times this occurs. Which command will provide the accurate count?

  • grep -v 'refused' /var/log/auth.log | wc -l

  • grep -c 'refused' /var/log/auth.log

  • grep 'refused' /var/log/auth.log | wc -l

  • grep 'refused' /var/log/auth.log -c

Question 7 of 15

A Linux server with sufficient swap space will never encounter an Out of Memory condition.

  • True

  • False

Question 8 of 15

An administrator is attempting to run a graphical network configuration tool with elevated privileges on a desktop Linux system that uses PolicyKit. The administrator needs to ensure that the proper policy rules are respected, and that any authorization prompts are presented graphically. Which command should the administrator use to execute the network configuration tool?

  • pexec network-configuration-tool

  • pkexec network-configuration-tool

  • polkit network-configuration-tool

  • sudo network-configuration-tool

Question 9 of 15

A system administrator is setting up a new web server that requires encrypted data transfer. Which of the following would be the best to implement on the server to enable HTTPS communication?

  • A wildcard certificate

  • A self-signed certificate

  • An SSL/TLS certificate

  • A digital signature

Question 10 of 15

When a container is set to use the host networking mode, it will share the networking namespace with the host machine allowing the container to listen on the host's IP address.

  • True

  • False

Question 11 of 15

What is the primary purpose of using the mv command in a Linux environment?

  • Changing file permissions

  • Creating a duplicate of a file

  • Copying files to a new directory

  • Moving and renaming files and directories

Question 12 of 15

A system administrator needs to write a shell script that will output 'Large file detected' if a specified file size exceeds 1024 kilobytes. Which of the following shell script code blocks is the BEST to accomplish this?

  • if [ $(stat -c%s "file.txt") -gt 1024 ]; then echo 'Large file detected'; fi

  • if [ $(stat -c%s "file.txt") -gt 1048576 ]; then echo 'Large file detected'; fi

  • if [[ $(stat -c%s "file.txt") -gt 1024 ]]; then echo 'Large file detected'; fi

  • if [ $(stat -c%s "file.txt") / 1024 -gt 1024 ]; then echo 'Large file detected'; fi

Question 13 of 15

Which command utility can be used to search for and replace patterns within a file, and it requires no additional scripting or programming?

  • tail

  • sed

  • awk

  • grep

Question 14 of 15

Using the groupadd command with the -r option creates a system group.

  • True

  • False

Question 15 of 15

To create a new archive with cpio, which of the following commands would you use, given that you have a list of files to archive from a file called 'filelist.txt'?

  • cpio -o < filelist.txt

  • cpio -ov < filelist.txt > archive.cpio

  • tar -cf filelist.txt archive.cpio

  • cpio -iv < filelist.txt > archive.cpio