CompTIA Linux+ (v7) Free Sample Questions

Description

Covers the filesystem hierarchy, boot process and package management, security best practices and authentication, shell scripting and container operations, and storage and network troubleshooting.

20 free sample questions279 in the full practice test Other versions: XK0-006(161),XK0-004(218)

Try simulator

XK0-005 Sample Questions

  1. Question 1

    Intermediate

    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?

    Answer and explanation

    Correct answer: A

  2. Question 2

    Intermediate

    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?

    Answer and explanation

    Correct answer: D

  3. Question 3

    Intermediate

    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.git reflogB.git pullC.git statusD.git push

    Answer and explanation

    Correct answer: B

  4. Question 4

    Intermediate

    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?

    Answer and explanation

    Correct answer: D

  5. Question 5

    Intermediate

    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?

    Answer and explanation

    Correct answer: D

  6. Question 6

    Intermediate

    A user is asking the systems administrator for assistance with writing a script to verify whether a file exists. Given the following:Which of the following commands should replace the string? A.if [ -f "$filename" ]; thenB.if [ -d "$filename" ]; thenC.if [ -f "$filename" ] thenD.if [ -f "$filename" ]; while

    Question 6 image
    Answer and explanation

    Correct answer: A

  7. Question 7

    Intermediate

    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?

    Question 7 image
    Answer and explanation

    Correct answer: D

  8. Question 8

    Intermediate

    Which of the following technologies can be used as a central repository of Linux users and groups?

    Answer and explanation

    Correct answer: A

  9. Question 9

    Intermediate

    A systems administrator is troubleshooting connectivity issues and trying to find out why a Linux server is not able to reach other servers on the same subnet it is connected to. When listing link parameters, the following is presented:Based on the output above, which of following is the MOST probable cause of the issue?

    Question 9 image
    Answer and explanation

    Correct answer: D

  10. Question 10

    Intermediate

    System Management · Given a scenario, configure and manage storage in a Linux environment.

    A system administrator is managing a high-performance computing cluster where nodes frequently write large temporary files. To optimize I/O and reduce disk wear on the underlying SSDs, the administrator decides to use a tmpfs mount for /tmp. The system has 128GB of RAM. The requirement is to limit the tmpfs mount to 25% of the system's RAM and ensure it is mounted automatically on boot. Which entry in /etc/fstab correctly implements this?

    Answer and explanation

    Correct answer: B

    This /etc/fstab entry correctly configures a tmpfs filesystem. The device is tmpfs, the mount point is /tmp, the filesystem type is tmpfs, and the options defaults,size=32g set the standard mount options while limiting the filesystem size to 32GB (25% of 128GB). The 0 0 at the end indicates that the filesystem should not be dumped and should have a pass number of 0 for fsck, which is correct for a non-persistent filesystem like tmpfs.

Register free for 10 more questions

Or unlock all 279 XK0-005 questions with explanations, timed mode and flashcards.