2026 Latest CompTIA XK0-005 Real Exam Dumps PDF [Q438-Q459]

Share

2026 Latest CompTIA XK0-005 Real Exam Dumps PDF

XK0-005 Exam Dumps, XK0-005 Practice Test Questions


CompTIA XK0-005 exam is an excellent way for IT professionals to validate their Linux system administration skills and earn a globally recognized certification. With the increasing demand for Linux system administrators in the industry, the CompTIA Linux+ certification can open up new opportunities for career growth and advancement.

 

NEW QUESTION # 438
A systems administrator has been unable to terminate a process. Which of the following should the administrator use to forcibly stop the process?

  • A. kill -15
  • B. kill -1
  • C. kill -9
  • D. kill -TERM
  • E. kill -HUP

Answer: E


NEW QUESTION # 439
An administrator is troubleshooting a database service outage that was reported by a monitoring system. Given the following output:
$ systemctl status mariadb
Oct 20 16:40:45 comptia systemd[1]: mariadb.service: Main process exited, code=killed, status=9/KILL Oct 20 16:40:45 comptia systemd[1]: mariadb.service: Failed with result 'signal'.
Oct 20 16:40:50 comptia systemd[1]: Stopped MariaDB 10.3 database server.
$ dmesg
[ 1061.491433] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom, task_memcg=/system.slice/mariadb.service, task=mysqld,pid=1981,uid=27
[ 1061.491453] Out of memory: Killed process 1981 (mysqld) total-vm:330668kB, anon-rss:31316kB, file-rss:OkB, shmem-rss:OkB, UID:27 pgtables:324kB oom_score_adj:0 Which of the following is the reason for the outage?

  • A. The server does not have enough physical memory
  • B. The server is missing the DMA bus
  • C. The administrator sent a kill signal to the database
  • D. The database cannot write anything else to the storage

Answer: A

Explanation:
The oom-killer was invoked because the system ran out of memory, and as a result, it killed the mysqld process to free memory. This is a clear indication that the server did not have enough physical memory to run the MariaDB service, leading to the process being terminated.


NEW QUESTION # 440
A systems administrator detected corruption in the /data filesystem. Given the following output:

Which of the following commands can the administrator use to best address this issue?

  • A. umount /data
    fsck /dev/ sdcl
    mount / data
  • B. umount /data
    pvs /dev/sdcl
    mount /data
  • C. umount /data
    mkfs . xfs /dev/sclcl
    mount /data
  • D. umount /data
    xfs repair /dev/ sdcl
    mount /data

Answer: D

Explanation:
Explanation
The xfs repair command is used to check and repair an XFS filesystem, which is the type of filesystem used for the /data partition, as shown in the output. The administrator needs to unmount the /data partition before running the xfs repair command on it, and then mount it back after the repair is done. For example: umount
/data; xfs_repair /dev/sdcl; mount /data. The mkfs.xfs command is used to create a new XFS filesystem, which would erase all the data on the partition. The fsck command is used to check and repair other types of filesystems, such as ext4, but not XFS. The pvs command is used to display information about physical volumes in a logical volume manager (LVM) setup, which is not relevant for this issue.


NEW QUESTION # 441
A systems administrator is investigating why one of the servers has stopped connecting to the internet.

Which of the following is causing the issue?

  • A. The search entry in the /etc/resolv.conf file is incorrect.
  • B. Wired connection 1 is offline.
  • C. No default route is defined.
  • D. The DNS address has been commented out in the configuration file.

Answer: C

Explanation:
Explanation
The issue is caused by the lack of a default route defined in the /etc/sysconfig/network-scripts/ifcfg-enp0s3 file. A default route is a special route that specifies where to send packets that do not match any other routes in the routing table. Without a default route, the server will not be able to communicate with hosts outside its local network. The default route is usually configured with the GATEWAY option in the network interface configuration file. For example, to set the default gateway to 192.168.1.1, the file should contain:
GATEWAY=192.168.1.1
The other options are not causing the issue. The DNS address is not commented out in the configuration file, it is specified with the DNS1 option. The search entry in the /etc/resolv.conf file is correct, it specifies the domain name to append to unqualified hostnames. Wired connection 1 is online, as indicated by the ONBOOT=yes option and the output of ip link show enp0s3 command. References: Configuring IP Networking with nmcli; Configuring IP Networking with ifcfg Files


NEW QUESTION # 442
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. chcon system_u:object_r:ssh_home_t /etc/ssh/*
  • B. firewall-cmd -- zone=public -- add-port=2222/tcp
  • C. semanage port -a -t ssh_port_t -p tcp 2222
  • D. iptables -A INPUT -p tcp -- dport 2222 -j ACCEPT

Answer: C

Explanation:
This command will allow the SSH server to bind to port 2222 by adding it to the SELinux policy.
The semanage command is a utility for managing SELinux policies. The port subcommand is used to manage network port definitions. The -a option is used to add a new record, the -t option is used to specify the SELinux type, the -p option is used to specify the protocol, and the tcp 2222 argument is used to specify the port number. The ssh_port_t type is the default type for SSH ports in SELinux.


NEW QUESTION # 443
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. kexec
  • C. realm
  • D. kioad
  • E. klist
  • F. pkexec

Answer: A,E

Explanation:
The following commands can help the user to authenticate and show the ticket grants using Kerberos SSO on a Linux server:
* kinit: This command obtains and caches an initial ticket-granting ticket (TGT) for the user from the Kerberos key distribution center (KDC). The user needs to enter their password or use a keytab file to authenticate1.
* klist: This command lists the cached tickets, including the TGT and any service tickets, for the user. It also shows the expiration time and flags for each ticket2.
For example, the user can run the following commands to log in and view their tickets:
$ kinit username@REALM
Password for username@REALM:
$ klist
Ticket cache: FILE:/tmp/krb5cc_1000
Default principal: username@REALM
Valid starting Expires Service principal
04/06/2023 16:06:59 04/07/2023 02:06:59 krbtgt/REALM@REALM
renew until 04/13/2023 16:06:59
References:
* kinit(1) - Linux man page, section "Description".
* klist(1) - Linux man page, section "Description".


NEW QUESTION # 444
Which of the following characteristics of YAML and JSON are the most accurate?

  • A. JSON uses indentation and substantial white space, while YAML relies on curly braces and semicolons for data structuring.
  • B. JSON is a data interchange format used for configuration files and APIs, whereas YAML is a lightweight markup language frequently used for HTML and XML documents.
  • C. Due to its ease of use and broad compatibility, JSON is frequently used for configuration files and web APIs, whereas YAML is renowned for its support and human-readable, concise syntax.
  • D. YAML is preferred for its rigorous data type and significant support for complex data structures, while JSON is typically used for simple data structures and web APIs.

Answer: C

Explanation:
* JSONis widely used inAPIs and automation toolsdue to its structured format and broad language support.
* YAMLis designed to be more human-readable and concise, used often inAnsible, Kubernetes, and other configuration scenarios.
Option B best captures this distinction.
Reference:CompTIA Linux+ XK0-005 Study Guide, Domain 2.4 - Automation and Scripting
"YAML provides a concise syntax, while JSON is commonly used for APIs and tools that require strict parsing."


NEW QUESTION # 445
The security team has identified a web service that is running with elevated privileges A Linux administrator is working to change the systemd service file to meet security compliance standards. Given the following output:

Which of the following remediation steps will prevent the web service from running as a privileged user?

  • A. Changing the:nulti-user.target in the [Install] section to basic.target
  • B. Adding the User-webservice to the [Service] section of the service file
  • C. Removing the ExecStarWusr/sbin/webserver -D SOPTIONS from the service file
  • D. Updating the Environment File line in the [Service] section to/home/webservice/config

Answer: B

Explanation:
The remediation step that will prevent the web service from running as a privileged user is adding the User=webservice to the [Service] section of the service file. The service file is a configuration file that defines the properties and behavior of a systemd service. The systemd is a system and service manager that controls the startup and operation of Linux systems. The service file contains various sections and options that specify how the service should be started, stopped, and managed. The [Service] section defines how the service should be executed and what commands should be run. The User option specifies the user name or ID that the service should run as. The webservice is the name of the user that the administrator wants to run the web service as. The administrator should add the User=webservice to the [Service] section of the service file, which will prevent the web service from running as a privileged user, such as root, and improve the security of the system. This is the correct remediation step to use to prevent the web service from running as a privileged user. The other options are incorrect because they either do not change the user that the service runs as (removing the ExecStart=/usr/sbin/webserver -D OPTIONS from the service file or updating the EnvironmentFile line in the [Service] section to /home/webservice/config) or do not affect the user that the service runs as (changing the multi-user.target in the [Install] section to basic.target). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15: Managing System Services, page 458.


NEW QUESTION # 446
A systems technician needs to install a third-party software package. Which of the following commands would allow the technician to download this software package from a remote server?

  • A. nc
  • B. netstat
  • C. telnet
  • D. wget

Answer: D


NEW QUESTION # 447
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 checkout -b staging
  • B. git commit -m staging
  • C. git status -b staging
  • D. git branch -m staging

Answer: A

Explanation:
The git checkout -b staging command creates a new branch called staging and switches to it. This is useful when you want to create a new branch locally and begin working on it. The -b flag is used to create the branch if it doesn't exist.


NEW QUESTION # 448
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 <CONDITIONAL> string?

  • A. if [ -f "$filename" ]; while
  • B. if [ -f "$filename" ]; then
  • C. if [ -f "$filename" ] then
  • D. if [ -d "$filename" ]; then

Answer: B

Explanation:
Explanation
The command if [ -f "$filename" ]; then checks if the variable $filename refers to a regular file that exists.
The -f option is used to test for files. If the condition is true, the commands after then are executed. This is the correct way to replace the <CONDITIONAL> string. The other options are incorrect because they either use the wrong option (-d tests for directories), the wrong syntax (missing a semicolon after the condition), or the wrong keyword (while is used for loops, not conditions). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 16: Writing and Executing Bash Shell Scripts, page 493.


NEW QUESTION # 449
An issue was discovered on a testing branch of a Git repository. A file was inadvertently modified and needs to be reverted to the master branch version. Which of the following is the BEST option to resolve the issue?

  • A. git checkout master -- file
  • B. git stash branch master
  • C. git branch -b master file
  • D. git merge master testing

Answer: A

Explanation:
https://www.git-scm.com/book/en/v2/Git-Basics-Undoing-Things


NEW QUESTION # 450
Due to low disk space, a Linux administrator finding and removing all log files that were modified more than 180 days ago. Which of the following commands will accomplish this task?

  • A. find /var/log -type f -mtime +180 -exec rm {} \
  • B. find /var/log -type d -mtime +180 -print -exec rm {} \;
  • C. find /var/log -type c -atime +180 -remove
  • D. find /var/log -type f -modified +180 -rm

Answer: A

Explanation:
The command that will accomplish the task of finding and removing all log files that were modified more than 180 days ago is find /var/log -type f -mtime +180 -exec rm {} ;. This command will use find to search for files (-type f) under /var/log directory that have a modification time (-mtime) older than 180 days (+180). For each matching file, it will execute (-exec) the rm command to delete it, passing the file name as an argument ({}). The command will end with a semicolon (;), which is escaped with a backslash to prevent shell interpretation.
The other options are not correct commands for accomplishing the task. The find /var/log -type d -mtime +180 -print -exec rm {} ; command will search for directories (-type d) instead of files, and print their names (-print) before deleting them. This is not what the task requires. The find /var/log -type f -modified +180 -rm command is invalid because there is no such option as -modified or -rm for find. The correct options are -mtime and -delete, respectively. The find /var/log -type c -atime +180 -remove command is also invalid because there is no such option as -remove for find. Moreover, it will search for character special files (-type c) instead of regular files, and use access time (-atime) instead of modification time. Reference: find(1) - Linux manual page; Find and delete files older than n days in Linux


NEW QUESTION # 451
Which of the following can be used to boot a DVD from a remote device to initialize a Linux system setup on bare metal hardware as if it is a local DVD?

  • A. NFS
  • B. PXE
  • C. UEFI
  • D. GRUB

Answer: C

Explanation:
https://access.redhat.com/documentation/en-
us/red_hat_enterprise_linux/6/html/installation_guide/ch-boot-x86


NEW QUESTION # 452
Which of the following is a simple option to deter attackers who have physical access to a Linux system from performing a root account takeover?

  • A. Disabling the runlevel for single-user mode
  • B. Configuring a GRUB bootloader password
  • C. Purchasing a hardware security module
  • D. Removing the root user from the system

Answer: B


NEW QUESTION # 453
An administrator is reviewing suspicious activity on a server and needs to determine which users logged into the system within the past 24 hours.
Which of the following commands should the administrator run to determine this?

  • A. who
  • B. last
  • C. id
  • D. usermod

Answer: B

Explanation:
The last command in Linux is used to display the list of all the users logged in and out since the file /var/log/wtmp was created. One or more usernames can be given as an argument to display their login in (and out) time and their host-name.
The Linux "who" command lets you display the users currently logged in to your UNIX or Linux operating system.


NEW QUESTION # 454
A user needs to modify the IP address of a laptop. Which of the following files can be used to configure the network interface named eth0?

  • A. /etc/sysconfig/network-scripts/ifcfg-eth0
  • B. /etc/sysconfig/network/interfaces.cnf
  • C. /system/networking/ifconfig
  • D. /etc/interfaces/eth0.conf
  • E. /system/config/interfaces

Answer: A

Explanation:
Interface configuration files
Every network interface has its own configuration file in the /etc/sysconfig/network-scripts directory. Each interface has a configuration file named ifcfg-<interface-name>X, where X is the number of the interface, starting with zero or 1 depending upon the naming convention in use; for example /etc/sysconfig/network-scripts/ifcfg-eth0 for the first Ethernet interface.
https://opensource.com/life/16/6/how-configure-networking-linux


NEW QUESTION # 455
After listing the properties of a system account, a systems administrator wants to remove the expiration date of a user account. Which of the following commands will accomplish this task?

  • A. chgrp system accountname
  • B. passwd -s accountname
  • C. chmod -G system account name
  • D. chage -E -1 accountname

Answer: D

Explanation:
The command chage -E -1 accountname will accomplish the task of removing the expiration date of a user account. The chage command is a tool for changing user password aging information on Linux systems. The -E option sets the expiration date of the user account, and the -1 value means that the account will never expire. The command chage -E -1 accountname will remove the expiration date of the user account named accountname.


NEW QUESTION # 456
A systems administrator receives reports of issues in one of the Linux systems. The following output has been provided:
$ dig node.mycomptia.org
; <<>> DiG 9.11.36.x.x <<>> node.mycomptia.org
;; global options: +cmd
;; connection timed out; no servers could be reached
$ cat /etc/resolv.conf
search mycomptia.org
Which of the following actions will best resolve this issue? (Select two.)

  • A. echo "DNS1=8.8.8.8" >> /etc/sysconfig/network-scripts/ifcfg-eth0
  • B. systemctl restart networkd
  • C. systemctl restart named
  • D. echo "nameserver 8.8.8.8" >> /run/systemd/resolve/resolv.conf
  • E. echo "nameserver 8.8.8.8" >> /etc/resolv.conf
  • F. echo "8.8.8.8 node.mycomptia.org" >> /etc/hosts
  • G. systemctl restart NetworkManager

Answer: E,G


NEW QUESTION # 457
A systems administrator engineer wants to configure a Linux server's time zone to America/Chicago. The engineer verifies that the server's time zone is configured for Asia/Tokyo:

Which of the following commands should the engineer execute to make this change?

  • A. set-timezone -config America/Chicago
  • B. date configure -set-timezone America/Chicago
  • C. time date set America/Chicago
  • D. timedatect1 set-timezone America/Chicago

Answer: D

Explanation:
* timedatectl set-timezone is the correct systemd-based tool to change the system's time zone.
Reference:
CompTIA Linux+ XK0-005 Study Guide, Chapter 10
man timedatectl


NEW QUESTION # 458
While inspecting a recently compromised Linux system, the administrator identified a number of processes that should not have been running:

Which of the following commands should the administrator use to terminate all of the identified processes?

  • A. skill -9 "upload*.sh"
  • B. kill -9 "upload*.sh"
  • C. killall -9 -upload*.sh"
  • D. pkill -9 -f "upload*.sh"

Answer: D

Explanation:
The pkill -9 -f "upload*.sh" command will terminate all of the identified processes. This command will send a SIGKILL signal (-9) to all processes whose full command line matches the pattern "upload*.sh" (-f). This signal will force the processes to terminate immediately without giving them a chance to clean up or save their state. The kill -9 "upload*.sh" command is invalid, as kill requires a process ID (PID), not a pattern. The killall -9 "upload*.sh" command is incorrect, as killall requires an exact process name, not a pattern. The skill
-9 "upload*.sh" command is incorrect, as skill requires a username or a session ID (SID), not a pattern. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 15: Managing Memory and Process Execution, page 470.


NEW QUESTION # 459
......

PDF (New 2026) Actual CompTIA XK0-005 Exam Questions: https://www.newpassleader.com/CompTIA/XK0-005-exam-preparation-materials.html

Dumps Moneyack Guarantee - XK0-005 Dumps UpTo 90% Off: https://drive.google.com/open?id=1Tf9e2HwdrRMAMN8xwy0JIkSdRILzQyuR