Latest CompTIA XK0-005 Practice Test Questions, CompTIA Linux+ Certification Exam Exam Dumps
Feb-2026 Pass CompTIA XK0-005 Exam in First Attempt Easily
CompTIA XK0-005 exam is a valuable certification for IT professionals seeking to validate their skills and knowledge in Linux systems. CompTIA Linux+ Certification Exam certification is vendor-neutral and covers various Linux distributions, making it ideal for professionals working with different Linux-based technologies. With the CompTIA Linux+ certification, candidates can expand their career opportunities and demonstrate their expertise in managing, configuring, and troubleshooting Linux systems.
NEW QUESTION # 316
A systems administrator needs to install the file installer_0.17-41.2_amd64.deb. Which of the following commands should the administrator use?
- A. yum localinstall installer_0.17-41.2_amd64.deb
- B. dpkg -i installer_0.17-41.2_amd64.deb
- C. apt install installer
- D. rpm -i installer_0.17-41.2_amd64.deb
Answer: B
Explanation:
Step-by-Step Comprehensive Detailed
Command
dpkg -i installs .deb files on Debian-based systems like Ubuntu.
Why Other Options are Incorrect:
A: apt install installs packages from repositories, not local .deb files.
C: rpm -i is used for .rpm files, not .deb.
D: yum localinstall is used for .rpm files.
Reference:
CompTIA Linux+ Study Guide: Package Management
man dpkg
NEW QUESTION # 317
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. visudo Joe
- C. sudo Joe
- D. pkexec joe
Answer: A
Explanation:
The su command is used to switch to another user account on Linux systems. The - option makes the shell a login shell, which means that it will read the profile and environment variables of the target user. Without this option, the shell will retain the environment variables of the original user. This can cause confusion when issuing commands that depend on these variables, such as ls, which uses the $HOME variable to determine the home directory. Therefore, Ann should have issued su - Joe to list Joe's files instead of her own. Reference: [How to Use su Command in Linux with Examples]
NEW QUESTION # 318
A systems administrator has been tasked with disabling the nginx service from the environment to prevent it from being automatically and manually started. Which of the following commands will accomplish this task?
- A. systemct1 disable nginx
- B. systemct1 stop nginx
- C. systemct1 cancel nginx
- D. systemct1 mask nginx
Answer: D
Explanation:
Explanation
The command systemct1 mask nginx disables the nginx service from the environment and prevents it from being automatically and manually started. This command creates a symbolic link from the service unit file to
/dev/null, which makes the service impossible to start. This is the correct way to accomplish the task. The other options are incorrect because they either do not exist (systemct1 cancel nginx), do not prevent manual start (systemct1 disable nginx), or do not prevent automatic start (systemct1 stop nginx). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Processes and Scheduling Tasks, page 429.
NEW QUESTION # 319
A junior administrator is setting up a new Linux server that is intended to be used as a router at a remote site.
Which of the following parameters will accomplish this goal?
- A. Install and configure a routing daemon like quagga or bird
- B. Set up NAT (Network Address Translation) with iptables
- C. Disable firewall settings
- D. Enable IP forwarding by running sysctl -w net.ipv4.ip_forward=1
Answer: B
Explanation:
The parameter net.ipv4.ip_forward=1 will accomplish the goal of setting up a new Linux server as a router.
This parameter enables the IP forwarding feature, which allows the server to forward packets between different network interfaces. This is necessary for a router to route traffic between different networks. The parameter can be set in the /etc/sysctl.conf file or by using the sysctl command. This is the correct parameter to use to accomplish the goal. The other options are incorrect because they either do not exist (net.ipv4.
ip_forwarding or net.ipv4.ip_route) or do not enable IP forwarding (net.ipv4.
ip_forward=0). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 382.
NEW QUESTION # 320
A systems administrator notices the process list on a mission-critical server has a large number of processes that are in state "Z" and marked as "defunct." Which of the following should the administrator do in an attempt to safely remove these entries from the process list?
- A. Kill the PID of the processes.
- B. Reboot the server.
- C. Kill the process with PID 1.
- D. Kill the parent PID of the processes.
Answer: D
Explanation:
Explanation
As the web search results show, processes in state Z are defunct or zombie processes, which means they have terminated but their parent process has not reaped them properly. They do not consume any resources, but they occupy a slot in the process table. To remove them from the process list, the administrator needs to kill the parent process of the zombies, which will cause them to be reaped by the init process (PID 1). Killing the zombies themselves or the init process will not have any effect, as they are already dead. Rebooting the server may work, but it is not a safe or efficient option, as it may cause unnecessary downtime or data loss for a mission-critical server.
References
Processes in a Zombie (Z) or Defunct State | Support | SUSE, paragraph 3 linux - Zombie vs Defunct processes? - Stack Overflow, answer by admirableadmin How To Kill Zombie Processes on Linux | Linux Journal, paragraph 4
NEW QUESTION # 321
A systems administrator wants to permit access temporarily to an application running on port
1234/TCP on a Linux server. Which of the following commands will permit this traffic?
- A. firewall-cmd --new-service=l234/tcp
- B. firewall-cmd --add-whitelist-uid=l234
- C. firewall-cmd --service=l234 --protocol=tcp
- D. firewall-cmd --add-port=1234/tcp
Answer: D
Explanation:
The firewall-cmd command is used to manage firewalld, which is a firewall service for Linux systems that provides dynamic and persistent configuration of firewall rules. Firewalld uses zones and services to define different levels of trust and access for network connections. To permit access temporarily to an application running on port 1234/TCP on a Linux server, the systems administrator can use the firewall-cmd --add-port=1234/tcp command. This command will add a rule to the default zone (usually public) that allows incoming traffic on port 1234/TCP. The rule will only be effective until the next reload or restart of firewalld. To make the rule permanent, the administrator can add the --permanent option to the command.
NEW QUESTION # 322
While troubleshooting server issues, a Linux systems administrator obtains the following output:
[rootGhost ~]# total free -m used free shared buf f/cache available
Mem: 3736 3598 88 2 48 29
Swap: 2047 1824 223
Which of the following best describes the state of the system?
- A. The system has consumed the system memory and swap space.
- B. The system has allocated enough buffer space.
- C. The system has enough free memory space.
- D. The system has swap disabled.
Answer: C
Explanation:
The output shows that the system has a total of 3736MB of memory, of which 3598MB is free. This indicates that the system has enough free memory space12.
Reference:
1(https://phoenixnap.com/kb/swap-space)
2(https://www.baeldung.com/linux/swap-space-use)
NEW QUESTION # 323
A new hard drive /dev/sdd was added to a server. Which of the following commands will create a partition table with a single partition /dev/sdd1 that consumes the entire disk?
- A. sudo sfdisk /dev/sdd -t=83
- B. echo 'auto' | sudo fdisk /dev/sdd
- C. echo 'type=83' | sudo sfdisk /dev/sdd
- D. sudo fdisk /dev/sdd -1 -t=83
Answer: C
Explanation:
The sfdisk tool is used to manipulate partition tables in Linux. Option A creates a single partition on /dev/sdd of type 83 (Linux filesystem).
type=83 specifies the partition type for Linux.
The command pipes this configuration to sfdisk to apply it directly to /dev/sdd.
NEW QUESTION # 324
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. No default route is defined.
- B. Wired connection 1 is offline.
- C. The DNS address has been commented out in the configuration file.
- D. The search entry in the /etc/resolv.conf file is incorrect.
Answer: C
NEW QUESTION # 325
A Linux administrator is tasked with adding users to the system. However, the administrator wants to ensure the users' access will be disabled once the project is over. The expiration date should be 2021- 09-30. Which of the following commands will accomplish this task?
- A. sudo modinfo -F 2021-09-30 Project_uses
- B. sudo useradd -e 2021-09-30 Project_user
- C. sudo useradd -m -d 2021-09-30 Project_user
- D. sudo useradd -c 2021-09-30 Project_user
Answer: B
Explanation:
The command that will accomplish this task is sudo useradd -e 2021-09-30 Project_user. This command will create a new user account named Project_user with an expiration date of 2021-09-
30. The -e option of useradd specifies the date on which the user account will be disabled in YYYY-MM- DD format.
NEW QUESTION # 326
A Linux systems administrator is preparing to install updates using APT. The administrator notices the version of the packages that will be installed differs from the latest version on the Ubuntu website. Which of the following commands should the administrator use to obtain the latest version of the package?
- A. apt-get cache update
- B. apt-get refresh
- C. apt purge
- D. apt update
Answer: D
NEW QUESTION # 327
A Linux administrator needs to resolve a service that has failed to start. The administrator runs the following command:
The following output is returned
Which of the following is MOST likely the issue?
- A. The service startupfile cannot be owned by root.
- B. The service startupfile size cannot be 81k.
- C. The service does not have permissions to read write the startupfile.
- D. The service startupfile should not be owned by the root group.
Answer: C
Explanation:
Explanation
The most likely issue is that the service does not have permissions to read or write the startupfile. The output of systemct1 status startup.service shows that the service has failed to start and the error message is
"Permission denied". The output of ls -l /etc/startupfile shows that the file has the permissions -rw-r--r--, which means that only the owner (root) can read and write the file, while the group (root) and others can only read the file. The service may not run as root and may need write access to the file. The administrator should change the permissions of the file by using the chmod command and grant write access to the group or others, or change the owner or group of the file by using the chown command and assign it to the user or group that runs the service. The other options are incorrect because they are not supported by the outputs. The file size, owner, and group are not the causes of the issue. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing Files and Directories, pages 345-346.
NEW QUESTION # 328
An administrator needs to stop a foreground process in between its execution in a terminal.
Which of the following should the administrator use?
- A. Ctrl+Z
- B. Ctrl+F
- C. Ctrl+C
- D. Ctrl+D
Answer: C
Explanation:
Ctrl+C sends a SIGINT (interrupt signal) to the foreground process, stopping its execution.
NEW QUESTION # 329
A Linux user is trying to execute commands with sudo but is receiving the following error:
$ sudo visudo
>>> /etc/sudoers: syntax error near line 28 <<<
sudo: parse error in /etc/sudoers near line 28
sudo: no valid sudoers sources found, quitting
The following output is provided:
# grep root /etc/shadow
root :* LOCK *: 14600 ::::::
Which of the following actions will resolve this issue?
- A. Boot the system in single user mode and comment out line 28 from /etc/sudoers.
- B. Log in directly using the root account and comment out line 28 from /etc/sudoers.
- C. Log in to the system using the other regular user, switch to root, and comment out line 28 from /etc
/sudoers. - D. Comment out line 28 from /etc/sudoers and try to use sudo again.
Answer: A
NEW QUESTION # 330
A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?
- A. The checkdiskspace.service is not running.
- B. The OnCalendar schedule is incorrect in the timer definition.
- C. The checkdiskspace.service needs to be enabled.
- D. The system-daemon services need to be reloaded.
Answer: B
Explanation:
Explanation
The OnCalendar schedule is incorrect in the timer definition, which is causing the issue. The OnCalendar schedule defines when the timer should trigger the service. The format of the schedule is OnCalendar=<year>-<month>-<day> <hour>:<minute>:<second>. If any of the fields are omitted, they are assumed to be *, which means any value. Therefore, the schedule OnCalendar=*-*-* 00:00:00 means every day at midnight, which is why the job is running daily. To make the job run every two hours, the schedule should be OnCalendar=*-*-* *:00:00/2, which means every hour divisible by 2 at the start of the minute. The other options are incorrect because they are not related to the schedule. The checkdiskspace.service is running, as shown by the output of systemct1 status checkdiskspace.service. The checkdiskspace.service is enabled, as shown by the output of systemct1 is-enabled checkdiskspace.service. The system-daemon services do not need to be reloaded, as the timer and service definitions are already loaded by the restart. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Processes and Scheduling Tasks, page
437.
NEW QUESTION # 331
A user reported issues when trying to log in to a Linux server. The following outputs were received:
Given the outputs above. which of the following is the reason the user is unable to log in to the server?
- A. User1 is in the incorrect group.
- B. The user1 password is expired.
- C. The user1 shell assignment incorrect.
- D. User1 needs to set a long password.
Answer: B
Explanation:
The user1 password is expired. This can be inferred from the output of the chage -l user1 command, which shows the password expiration information for user1. The output shows that the password expired on 2020-10-01, and the account expired on 2020-10-08. This means that user1 cannot log in to the server unless the password and account are reactivated by the system administrator.
The other options are not correct based on the outputs above. User1 does not need to set a long password, because the output of the passwd -S user1 command shows that the password has a minimum length of 5 characters, which is met by user1's password. User1 is not in the incorrect group, because the output of the groups user1 command shows that user1 belongs to the app group, which is presumably the correct group for accessing the server. The user1 shell assignment is not incorrect, because the output of the grep user1 /etc/passwd command shows that user1 has /bin/bash as the default shell, which is a valid and common shell for Linux users.
NEW QUESTION # 332
An administrator needs to increase the system priority of a process with PID 2274. Which of the following commands should the administrator use to accomplish this task?
- A. ps -ef I grep 2274
- B. renice -n -15 2274
- C. echo "-15" > /proc/PID/2274/priority
- D. nice -15 2274
Answer: B
Explanation:
The renice command is used to change the priority of a running process by specifying its PID and the new nice value. The -n flag indicates the amount of change in the nice value, which can be positive or negative. A lower nice value means a higher priority, so -15 will increase the priority of the process with PID 2274. The administrator needs to have root privileges to do this.
References:
* The renice command is listed as one of the commands to manipulate process priority in the web search result 1.
* The renice command is also explained with examples in the web search result 2.
* The CompTIA Linux+ Certification Exam Objectives mention that the candidate should be able to
"manage process execution priorities" as part of the System Operation and Maintenance domain1.
NEW QUESTION # 333
A Linux administrator is removing non-permanent rules from the system firewall. Which of the following commands will allow the administrator to achieve this goal in the safest way possible?
- A. firewall-cmd --runtime-to-permanent
- B. firewall-cmd --set-default-zone
- C. firewall-cmd --complete-reload
- D. firewall-cmd --reload
Answer: D
Explanation:
firewall-cmd --runtime-to-permanent sets the current rules to permanent, it doesn't remove non- permanent rules. --reload will reload the firewall config and remove any non-persistent rules that were added during the current session.
NEW QUESTION # 334
A systems administrator is tasked with creating a cloud-based server with a public IP address.
Which of the following technologies did the systems administrator use to complete this task?
- A. Ansible
- B. Puppet
- C. Git
- D. Terraform
Answer: D
Explanation:
The systems administrator used Terraform to create a cloud-based server with a public IP address. Terraform is a tool for building, changing, and versioning infrastructure as code.
Terraform can create and manage resources on different cloud platforms, such as AWS, Azure, or Google Cloud. Terraform uses a declarative syntax to describe the desired state of the infrastructure and applies the changes accordingly. Terraform can also assign a public IP address to a cloud server by using the appropriate resource attributes.
NEW QUESTION # 335
......
Free XK0-005 Exam Files Downloaded Instantly 100% Dumps & Practice Exam: https://braindumpsschool.vce4plus.com/CompTIA/XK0-005-valid-vce-dumps.html