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:
    • Security
    • System Management
    • Scripting, Containers, and Automation
    • Troubleshooting
Question 1 of 15

The command 'at' can be used to schedule a job for a specific time without the requirement for that to recur at regular intervals.

  • The statement is accurate

  • The statement is inaccurate

Question 2 of 15

A system administrator notices that a Linux server is performing poorly and, upon investigation, discovers that the I/O wait time is consistently high, even under normal workload. The server hosts a database service that is critical for the company's operations. Which of the following actions should the administrator take FIRST to address the high I/O wait issue?

  • Upgrade to faster storage hardware, such as NVMe drives

  • Analyze disk I/O activity using utilities like iotop or iostat

  • Add additional RAM to the server to improve overall performance

  • Check for network issues that may be affecting storage access

Question 3 of 15

Which of the following commands is used to check and repair filesystem errors on a Linux system?

  • fdisk

  • mkfs

  • chmod

  • chown

  • dd

  • fsck

Question 4 of 15

A system administrator wants to generate a report of disk usage by each user in the home directory and store the output to a file called disk_report.txt, overwriting any existing data in the file. Which command should they use to accomplish this task?

  • du -h /home/* >> disk_report.txt

  • du -h /home/* < disk_report.txt

  • du -h /home/* &> disk_report.txt

  • du -h /home/* > disk_report.txt

Question 5 of 15

A system administrator has noticed that over time, a Linux server's available memory decreases, even when the workload on the server remains consistent. The 'top' command shows a particular process gradually increasing its memory usage without releasing it back to the system. Which of the following tools should the administrator use to further investigate this suspected memory leak in the problematic process?

  • free

  • mpstat

  • vmstat

  • valgrind

Question 6 of 15

A Linux administrator needs to configure a Linux server to send its system logs to a remote log server at the IP address 192.168.150.50. Which configuration line should the administrator add to the rsyslog configuration file to accomplish this task?

  • . @@192.168.150.50

  • . >192.168.150.50

  • . #192.168.150.50

  • . @192.168.150.50

Question 7 of 15

Using single-threaded I/O operations on a Solid State Drive (SSD) will always result in optimal throughput.

  • False

  • True

Question 8 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 9 of 15

A colleague informs you that a new feature has been added to a project, and it's available on the 'feature-login' branch for preview before it's merged into the main codebase. You are currently on the 'main' branch and have made some local modifications that you don't want to commit yet. How would you switch to the 'feature-login' branch to review the new additions without losing your uncommitted changes?

  • git checkout feature-login --force

  • git commit -m 'Temp commit' and then use git checkout feature-login

  • git stash your changes and then use git checkout feature-login

  • git merge feature-login into your main branch

Question 10 of 15

A system administrator has noticed SELinux is preventing a web application from functioning properly on a production server running the 'targeted' policy. The administrator wants to temporarily relax SELinux enforcement to diagnose the issue without entirely disabling SELinux or making permanent policy changes. Which command should the administrator use to fulfill this requirement?

  • setsebool -P

  • setenforce enforcing

  • setenforce Disabled

  • setenforce 0

  • enforce 0

Question 11 of 15

An administrator wishes to grant a user, john, the ability to restart the httpd service without providing a password. Which line should be added to the /etc/sudoers file to accomplish this?

  • john ALL=(ALL) NOPASSWD: systemctl restart httpd

  • john ALL=(ALL) /bin/systemctl restart httpd

  • john ALL=(ALL) NOPASSWD: ALL

  • john ALL=(ALL) NOPASSWD: /bin/systemctl restart httpd

Question 12 of 15

What command would you use to display all the currently running container instances in the system?

  • docker inspect

  • docker running

  • docker ps

  • docker list

Question 13 of 15

An administrator has just completed the installation of a new kernel on a Linux system. After installing the kernel and related modules, they wish to update the GRUB2 bootloader configuration to ensure that the system will boot using this new kernel. Which of the following commands should the administrator run to correctly generate a new configuration and ensure the new kernel is bootable?

  • mkinitrd /boot/initrd.img

  • grub2-mkconfig -o /boot/grub2/grub.cfg

  • grub2-install

  • grub2-update

Question 14 of 15

An administrator notices that a recently mounted ext4 filesystem is not correctly recording the access times of files when they are read. The administrator suspects that a mount option may be causing this behavior. Which of the following mount options did the administrator most likely use when mounting the filesystem?

  • sync

  • dirsync

  • relatime

  • noatime

Question 15 of 15

A system administrator notices that a Linux server is experiencing slow performance, specifically in disk operations. Upon investigating, the administrator discovered that the I/O wait time is considerably high. Which of the following actions is the BEST course of action to reduce the high latency affecting the system?

  • Deploy additional network interfaces to balance the I/O load.

  • Replace the current I/O scheduler with one that is better optimized for the system's workload.

  • Decrease the amount of RAM in the system to reduce the memory available for disk caching.

  • Increase the CPU clock speed to process I/O operations faster.