Exam Details

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

CompTIA CompTIA Certifications XK0-005 Questions & Answers

  • Question 171:

    A DevOps engineer is working on a local copy of a Git repository. The engineer would like to switch from the main branch to the staging branch but notices the staging branch does not exist. Which of the following Git commands should the engineer use to perform this task?

    A. git branch --m staging

    B. git commit --m staging

    C. git status --b staging

    D. git checkout --b staging

  • Question 172:

    A DevOps engineer needs to allow incoming traffic to ports in the range of 4000 to 5000 on a Linux server. Which of the following commands will enforce this rule?

    A. iptables -f filter -I INPUT -p tcp --dport 4000:5000 -A ACCEPT

    B. iptables -t filter -A INPUT -p tcp --dport 4000:5000 -j ACCEPT

    C. iptables filter -A INPUT -p tcp --dport 4000:5000 -D ACCEPT

    D. iptables filter -S INPUT -p tcp --dport 4000:5000 -A ACCEPT

  • Question 173:

    A Linux administrator is trying to start the database service on a Linux server but is not able to run it. The administrator executes a few commands and receives the following output: Which of the following should the administrator run to resolve this issue? (Select two).

    A. systemctl unmask mariadb

    B. journalctl --g mariadb

    C. dnf reinstall mariadb

    D. systemctl start mariadb

    E. chkconfig mariadb on

    F. service mariadb reload

  • Question 174:

    A database administrator requested the installation of a custom database on one of the servers. Which of the following should the Linux administrator configure so the requested packages can be installed?

    A. /etc/yum.conf

    B. /etc/ssh/sshd.conf

    C. /etc/yum.repos.d/db.repo

    D. /etc/resolv.conf

  • Question 175:

    A Linux administrator has been tasked with installing the most recent versions of packages on a RPM-based OS. Which of the following commands will accomplish this task?

    A. apt-get upgrade

    B. rpm -a

    C. yum updateinfo

    D. dnf update

    E. yum check-update

  • Question 176:

    A senior Linux administrator has created several scripts that will be used to install common system applications. These scripts are published to a reposito-ry to share with the systems team. A junior Linux administrator needs to re-trieve the scripts and make them available on a local workstation. Which of the following Git commands should the junior Linux administrator use to accom-plish this task?

    A. fetch

    B. checkout

    C. clone

    D. branch

  • Question 177:

    An administrator created an initial Git repository and uploaded the first files. The administrator sees the following when listing the repository:

    The administrator notices the file . DS STORE should not be included and deletes it from the online repository. Which of the following should the administrator run from the root of the local repository before the next commit to ensure the file is not uploaded again in future commits?

    A. rm -f .DS STORE andand git push

    B. git fetch andand git checkout .DS STORE

    C. rm -f .DS STORE andand git rebase origin main

    D. echo .DS STORE >> .gitignore

  • Question 178:

    An administrator added the port 2222 for the SSH server on myhost and restarted the SSH server. The administrator noticed issues during the startup of the service. Given the following outputs: Which of the following commands will fix the issue?

    A. semanage port -a -t ssh_port_t -p tcp 2222

    B. chcon system_u:object_r:ssh_home_t /etc/ssh/*

    C. iptables -A INPUT -p tcp -- dport 2222 -j ACCEPT

    D. firewall-cmd -- zone=public -- add-port=2222/tcp

  • Question 179:

    A Linux system is failing to start due to issues with several critical system processes. Which of the following options can be used to boot the system into the single user mode? (Choose two.)

    A. Execute the following command from the GRUB rescue shell: mount -o remount, ro/sysroot.

    B. Interrupt the boot process in the GRUB menu and add systemd.unit=single in the kernel line.

    C. Interrupt the boot process in the GRUB menu and add systemd.unit=rescue.target in the kernel line.

    D. Interrupt the boot process in the GRUB menu and add single=user in the kernel line.

    E. Interrupt the boot process in the GRUB menu and add init=/bin/bash in the kernel line.

    F. Interrupt the boot process in the GRUB menu and add systemd.unit=single.target in the kernel line.

  • Question 180:

    A Linux system is failing to boot. The following error is displayed in the serial console:

    [[1;33mDEPEND[Om] Dependency failed for /data.

    [[1;33mDEPEND[Om] Dependency failed for Local File Systems

    ...

    Welcome to emergency mode! After logging in, type "journalctl -xb" to viewsystem logs, "systemct1 reboot" to reboot, "systemct1 default" to try again to boot into default mode.

    Give root password for maintenance

    (or type Control-D to continue}

    Which of the following files will need to be modified for this server to be able to boot again?

    A. /etc/mtab

    B. /dev/sda

    C. /etc/fstab

    D. /ete/grub.conf

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.