Exam Details

  • Exam Code
    :XK0-005
  • Exam Name
    :CompTIA Linux+
  • Certification
    :CompTIA Certifications
  • Vendor
    :CompTIA
  • Total Questions
    :396 Q&As
  • Last Updated
    :Mar 23, 2025

CompTIA CompTIA Certifications XK0-005 Questions & Answers

  • Question 231:

    A systems administrator is troubleshooting a connectivity issue pertaining to access to a system named db.example.com. The system IP address should be 192.168.20.88. The administrator issues the dig command and receives the following output:

    The administrator runs grep db.example.com /etc/hosts and receives the following output:

    Given this scenario, which of the following should the administrator do to address this issue?

    A. Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.89.

    B. Modify the /etc/network file and change the db.example.com entry to 192.168.20.88.

    C. Modify the /etc/network file and change the db.example.com entry to 192.168.20.89.

    D. Modify the /etc/hosts file and change the db.example.com entry to 192.168.20.88.

  • Question 232:

    A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?

    A. docker run -ti app /bin/sh

    B. podman exec -ti app /bin/sh

    C. podman run -d app /bin/bash

    D. docker exec -d app /bin/bash

  • Question 233:

    A developer is trying to install an application remotely that requires a graphical interface for installation. The developer requested assistance to set up the necessary environment variables along with X11 forwarding in SSH. Which of the following environment variables must be set in remote shell in order to launch the graphical interface?

    A. $RHOST

    B. SETENV

    C. $SHELL

    D. $DISPLAY

  • Question 234:

    A user is unable to log on to a Linux workstation. The systems administrator executes the following command:

    cat /etc/shadow | grep user1

    The command results in the following output:

    user1 :! $6$QERgAsdvojadv4asdvaarC/9dj34GdafGVaregmkdsfa:18875:0:99999:7 :::

    Which of the following should the systems administrator execute to fix the issue?

    A. chown -R userl:user1 /home/user1

    B. sed -i '/ ::: / :: /g' /etc/shadow

    C. chgrp user1:user1 /home/user1

    D. passwd -u user1

  • Question 235:

    A Linux systems administrator receives a notification that one of the server's filesystems is full. Which of the following commands would help the administrator to identify this filesystem?

    A. lsblk

    B. fdisk

    C. df -h

    D. du -ah

  • Question 236:

    After connecting to a remote host via SSH, an administrator attempts to run an application but receives the following error:

    [user@workstation ~]$ ssh admin@srv1

    Last login: Tue Mar 29 18:03:34 2022

    [admin@srvl ~] $ /usr/local/bin/config_manager

    Error: cannot open display:

    [admin@srv1 ~] $

    Which of the following should the administrator do to resolve this error?

    A. Disconnect from the SSH session and reconnect using the ssh -x command.

    B. Add Options X11 to the /home/admin/.ssh/authorized_keys file.

    C. Open port 6000 on the workstation and restart the firewalld service.

    D. Enable X11 forwarding in /etc/ssh/ssh_config and restart the server.

  • Question 237:

    A Linux administrator needs to create a new user named user02. However, user02 must be in a different home directory, which is under /comptia/projects. Which of the following commands will accomplish this task?

    A. useradd -d /comptia/projects user02

    B. useradd -m /comptia/projects user02

    C. useradd -b /comptia/projects user02

    D. useradd -s /comptia/projects user02

  • Question 238:

    Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the Is command. The output displays files that reside in Ann's home directory instead of Joe's. Which of the following represents the command Ann should have issued in order to list Joe's files?

    A. su - Joe

    B. sudo Joe

    C. visudo Joe

    D. pkexec joe

  • Question 239:

    A user is attempting to log in to a Linux server that has Kerberos SSO ena-bled. Which of the following commands should the user run to authenticate and then show the ticket grants? (Select TWO).

    A. kinit

    B. klist

    C. kexec

    D. kioad

    E. pkexec

    F. realm

  • Question 240:

    A file called testfile has both uppercase and lowercase letters: $ cat testfile ABCDEfgH IJKLmnoPQ abcdefgH ijklLMNopq A Linux administrator is tasked with converting testfile into all uppercase and writing it to a new file with the name uppercase. Which of the following commands will achieve this task?

    A. tr '(A-Z}' '{a-z}' < testfile > uppercase

    B. echo testfile | tr "[Z-A]" "[z-a]" < testfile > uppercase

    C. cat testfile | tr '{z-a)' '{Z-A}' < testfile > uppercase

    D. tr '[a-z]' '[A-Z]' < testfile > uppercase

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only CompTIA exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your XK0-005 exam preparations and CompTIA certification application, do not hesitate to visit our Vcedump.com to find your solutions here.