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

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: 60 seconds per question (0 hours, 15 minutes, 0 seconds)
  • Included Objectives:
    • Troubleshooting
    • System Management
    • Security
    • Scripting, Containers, and Automation

What operation should be periodically performed on a solid-state storage device to indicate which sectors are no longer in use?

  • Increasing the partition size

  • Conducting a sector-by-sector backup

  • Performing a surface scan

  • Executing a trim command

  • Running a defragmentation program

A Linux administrator needs to verify if a newly installed web server is listening on the default port and is reachable from a remote system. Which command should the administrator use?

  • nmap -p 80 remote_server_ip

  • netstat -tuln | grep ':80'

  • dig remote_server_ip -p 80

  • openssl s_client -connect remote_server_ip:80

A system administrator needs to permanently change the hostname on a Linux server to 'server-prod'. They decide to directly edit the necessary file to apply the hostname change across reboots. Which file should the administrator edit to achieve this?

  • /etc/hosts

  • /etc/sysconfig/hostname

  • /etc/hostname

  • /etc/hostname.conf

You are configuring a Linux server and need to prioritize LDAP for user and group lookups but want to fall back to the local /etc/passwd and /etc/group files if the LDAP lookup fails. Which of the following configurations would you implement in /etc/nsswitch.conf to achieve this requirement?

  • passwd: files nis ldap group: files nis ldap

  • passwd: nis files ldap group: nis files ldap

  • passwd: ldap files group: ldap files

  • passwd: files ldap group: files ldap

What is the primary purpose of the 'cat' command in a Linux environment?

  • To compare the contents of files line by line

  • To read and display the content of files on standard output

  • To edit the contents of a text file interactively

  • To display the first few lines of a file

A system administrator is deploying a multi-container application on a single Docker host. The application includes a web server container that needs to communicate with a database container. Both containers should be isolated from other network traffic on the Docker host. Which Docker network driver should the administrator use to fulfill these requirements?

  • Host

  • Overlay

  • Bridge

  • Default bridge

After successfully compiling a program from source code using 'make', which command should be used to install the compiled software into the system-wide directories so that it becomes executable from any location?

  • make config

  • make install

  • install make

  • make setup

A system administrator needs to verify the active firewall rules on a Linux server to ensure compliance with the company's security policies. Which of the following commands provides the most comprehensive output of the currently active firewall rules?

  • iptables -S

  • iptables -L -v -n

  • iptables --state

  • iptables -L

A system administrator needs to verify the SSL certificate information of a web server at the domain '' running on the default HTTPS port. Which command should be used to retrieve and display the certificate details?

  • openssl s_client -verify

  • openssl s_client -connect -cert

  • openssl s_client -host -port 443

  • openssl s_server -connect

  • openssl s_client -tls1_2 -connect

  • openssl s_client -connect -showcerts

A system administrator has noticed that applications are having trouble accessing configuration files stored on a mounted filesystem. Upon inspection, the system logs indicate read errors on the filesystem in question. The administrator suspects filesystem corruption. Which command should be executed to check and repair the filesystem while it’s unmounted, preventing further damage or potential data loss?

  • mkfs -t ext4 /dev/sda2

  • fsck /dev/sda2

  • e2fsck /dev/sda2

  • fdisk /dev/sda2

You have been tasked with deleting a user account on a Linux server, and you must ensure that the user's home directory and mail spool is also removed. Which command should you execute?

  • userdel -r username

  • usermod --delete username

  • userdel --remove-all-files username

  • deluser --remove username

A user reports that they are unable to write to a file named 'report.txt' located in their home directory. However, they have confirmed that they can read the file. Which of the following is the BEST action to take in order to grant the user write access to the file?

  • Edit the /etc/fstab file to alter mounting options for the user's home directory

  • Change the file permissions to allow write access for the user

  • Change the ownership of the file using the chown command

  • Restart the file service to refresh user permissions

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

  • False

  • True

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 -c 'refused' /var/log/auth.log

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

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

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

A system administrator needs to obtain information about which server versions are running on open ports of a remote host. However, the administrator must avoid performing an intrusive scan that could disrupt network services. Which of the following commands should the administrator run to best meet these requirements?

  • nmap -sV --version-light target_host

  • nmap --top-ports=100 -sV target_host

  • nmap -sT --top-ports=10 target_host

  • nmap -A target_host

Remaining Time: