CompTIA XK0-005 Cert Guide PDF 100% Cover Real Exam Questions
Pass XK0-005 Exam - Real Questions and Answers
CompTIA XK0-005 certification exam is a valuable credential for IT professionals who work with Linux-based systems. CompTIA Linux+ Certification Exam certification validates the skills and knowledge required for Linux administration, configuration, networking, and security. Candidates can prepare for the exam using a variety of study resources and should have at least 12 months of hands-on experience with Linux systems.
There are no formal prerequisites for the CompTIA XK0-005 certification exam. However, CompTIA recommends that candidates have at least 12 months of experience in Linux system administration before taking the exam. Candidates should also have a basic understanding of Linux commands, editors, and shell scripting. A good understanding of networking concepts and protocols is also recommended.
CompTIA XK0-005, also known as CompTIA Linux+ Certification, is a globally recognized certification exam that validates the candidate's knowledge and skills in Linux systems administration. CompTIA Linux+ Certification Exam certification exam is intended for IT professionals with a basic understanding of Linux systems and commands. CompTIA Linux+ Certification Exam certification exam covers topics such as system architecture, Linux installation and package management, command-line operations, user and group management, networking, and security.
NEW QUESTION # 14
Application code is stored in Git. Due to security concerns, the DevOps engineer does not want to keep a sensitive configuration file, app . conf, in the repository. Which of the following should the engineer do to prevent the file from being uploaded to the repository?
- A. Run git exclude app. conf.
- B. Add app . conf to . gitignore.
- C. Add app . conf to . exclude.
- D. Run git stash app. conf.
Answer: B
Explanation:
Explanation
This will prevent the file app.conf from being tracked by Git and uploaded to the repository. The .gitignore file is a special file that contains patterns of files and directories that Git should ignore. Any file that matches a pattern in the .gitignore file will not be staged, committed, or pushed to the remote repository. The .gitignore file should be placed in the root directory of the repository and committed along with the other files.
The other options are incorrect because:
A: Run git exclude app.conf
This is not a valid Git command. There is no such thing as git exclude. The closest thing is git update-index
--assume-unchanged, which tells Git to temporarily ignore changes to a file, but it does not prevent the file from being uploaded to the repository.
B: Run git stash app.conf
This will temporarily save the changes to the file app.conf in a stash, which is a hidden storage area for uncommitted changes. However, this does not prevent the file from being tracked by Git or uploaded to the repository. The file will still be part of the working tree and the index, and it will be restored when the stash is popped or applied.
C: Add app.conf to .exclude
This will have no effect, because Git does not recognize a file named .exclude. The only files that Git uses to ignore files are .gitignore, $GIT_DIR/info/exclude, and core.excludesFile.
References:
Git - gitignore Documentation
D:gitignore file - ignoring files in Git | Atlassian Git Tutorial
Ignoring files - GitHub Docs
[CompTIA Linux+ Certification Exam Objectives]
NEW QUESTION # 15
A Linux systems administrator is setting up a new web server and getting 404 - NOT FOUND errors while trying to access the web server pages from the browser. While working on the diagnosis of this issue, the Linux systems administrator executes the following commands:
Which of the following commands will BEST resolve this issue?
- A. setenforce 0
- B. setsebool -P httpd_can_network_connect_db on
- C. restorecon -R -v /var/www/html
- D. sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
Answer: C
Explanation:
The command restorecon -R -v /var/www/html will best resolve the issue. The issue is caused by the incorrect SELinux context of the web server files under the /var/www/html directory. The output of ls -Z /var/www
/html shows that the files have the type user_home_t, which is not allowed for web content. The command restorecon restores the default SELinux context of files based on the policy rules. The options - R and -v are used to apply the command recursively and verbosely. This command will change the type of the files to httpd_sys_content_t, which is the correct type for web content. This will allow the web server to access the files and serve the pages to the browser. The other options are incorrect because they either disable SELinux entirely (sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config or setenforce 0), which is not a good security practice, or enable an unnecessary boolean (setsebool -P
httpd_can_network_connect_db on), which is not related to the issue. References: CompTIA Linux+ (XK0-
005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 535.
NEW QUESTION # 16
A Linux administrator needs to ensure that Java 7 and Java 8 are both locally available for developers to use when deploying containers. Currently only Java 8 is available. Which of the following commands should the administrator run to ensure both versions are available?
- A. docker image import java:7
- B. docker image pull java:7
- C. docker image build java:7
- D. docker image load java:7
Answer: B
Explanation:
Explanation
The command that the administrator should run to ensure that both Java 7 and Java 8 are locally available for developers to use when deploying containers is docker image pull java:7. This command will use the docker image pull subcommand to download the java:7 image from Docker Hub, which is the default registry for Docker images. The java:7 image contains Java 7 installed on a Debian-based Linux system. The administrator can also specify a different registry by using the syntax registry/repository:tag.
The other options are not correct commands for ensuring that both Java 7 and Java 8 are locally available for developers to use when deploying containers. The docker image load java:7 command will load an image from a tar archive or STDIN, not from a registry. The docker image import java:7 command will create a new filesystem image from the contents of a tarball, not from a registry. The docker image build java:7 command will build an image from a Dockerfile, not from a registry. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Automating Tasks; docker image pull | Docker Docs
NEW QUESTION # 17
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?
- A. Puppet
- B. Terraform
- C. Ansible
- D. Chef
Answer: B
Explanation:
The code snippet is written in Terraform language, which is a tool for building, changing, and versioning infrastructure as code. Terraform uses a declarative syntax to describe the desired state of the infrastructure and applies the changes accordingly. The code defines a resource of type aws_instance, which creates an AWS EC2 instance, and sets the attributes such as the AMI ID, instance type, security group IDs, and key name. The code also uses a count parameter to create three identical instances and assigns them different names using the count.index variable. This is the correct technology that the administrator is using. The other options are incorrect because they use different languages and syntaxes for infrastructure as code. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 559.
NEW QUESTION # 18
A Linux administrator was notified that a virtual server has an I/O bottleneck. The Linux administrator analyzes the following output:
Given there is a single CPU in the sever, which of the following is causing the slowness?
- A. The system is running out of swap space.
- B. The memory is exhausted.
- C. The processes are paging.
- D. The CPU is overloaded.
Answer: D
Explanation:
Explanation
The slowness is caused by the CPU being overloaded. The iostat command shows that the CPU utilization is
100%, which means that there are more processes competing for CPU time than the CPU can handle. The other options are incorrect because:
The system is not running out of swap space, as shown by the iostat command, which shows that there is no swap activity (si and so columns are zero).
The memory is not exhausted, as shown by the free -m command, which shows that there is still available memory (avail column) and free buffer/cache memory (buff/cache column).
The processes are not paging, as shown by the vmstat command, which shows that there are no major page faults (majflt column) and no swap activity (si and so columns). References: CompTIA Linux+ Study Guide, Fourth Edition, page 417-419, 424-425.
NEW QUESTION # 19
A junior Linux administrator is performing version control on a Git repository. The administrator is given a list of tasks to complete:
- List the currently installed Git release.
- Show the status reporting of the clone.
Which of the following commands would allow the administrator to complete these tasks?
(Choose two.)
- A. git --version
- B. git --help
- C. git clone --recursive
- D. git clone --dissociate
- E. git clone --shared
- F. git clone --progress
Answer: A,F
Explanation:
-- version
Prints the Git suite version that the git program came from.
-- progress
Progress status is reported on the standard error stream by default when it is attached to a terminal, unless --quiet is specified. This flag forces progress status even if the standard error stream is not directed to a terminal.
NEW QUESTION # 20
A Linux system is failing to boot with the following error:
Which of the following actions will resolve this issue? (Choose two.)
- A. Boot the system on a LiveCD/ISO.
- B. Execute grub-install --root-directory=/mnt and reboot.
- C. Interrupt the boot process in the GRUB menu and add rescue to the kernel line.
- D. Fix the partition modifying /etc/default/grub and reboot.
- E. Execute grub-install /dev/sdX and reboot.
- F. Interrupt the boot process in the GRUB menu and add single to the kernel line.
Answer: A,E
Explanation:
Explanation
The administrator should do the following two actions to resolve the issue:
Boot the system on a LiveCD/ISO. This is necessary to access the system and repair the boot loader. A LiveCD/ISO is a bootable media that contains a Linux distribution that can run without installation. The administrator can boot the system from the LiveCD/ISO and mount the root partition of the system to a temporary directory, such as /mnt.
Execute grub-install /dev/sdX and reboot. This will reinstall the GRUB boot loader to the disk device, where sdX is the device name of the disk, such as sda or sdb. The GRUB boot loader is a program that runs when the system is powered on and allows the user to choose which operating system or kernel to boot. The issue is caused by a corrupted or missing GRUB boot loader, which prevents the system from booting. The command grub-install will restore the GRUB boot loader and fix the issue.
The other options are incorrect because they either do not fix the boot loader (interrupt the boot process in the GRUB menu or fix the partition modifying /etc/default/grub) or do not use the correct syntax (grub-install
--root-directory=/mnt instead of grub-install /dev/sdX or rescue or single instead of recovery in the GRUB menu). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing the Linux Boot Process, pages 265-266.
NEW QUESTION # 21
A systems administrator wants to delete app . conf from a Git repository. Which of the following commands will delete the file?
- A. git rm app. conf
- B. git tag app. conf
- C. git checkout app . conf
- D. git commit app . conf
Answer: A
Explanation:
Explanation
To delete a file from a Git repository, the administrator can use the command git rm app.conf (D). This will remove the file "app.conf" from the working directory and stage it for deletion from the repository. The administrator can then commit the change with git commit -m "Delete app.conf" to finalize the deletion. The other commands will not delete the file, but either tag, commit, or checkout the file. References:
[CompTIA Linux+ Study Guide], Chapter 10: Working with Git, Section: Deleting Files with Git
[How to Delete Files from Git]
NEW QUESTION # 22
A junior systems administrator has just generated public and private authentication keys for passwordless login. Which of the following files will be moved to the remote servers?
- A. id_rsa.pub
- B. id_dsa.pem
- C. id_ecdsa
- D. id_rsa
Answer: A
Explanation:
The file id_rsa.pub will be moved to the remote servers for passwordless login. The id_rsa.pub file is the public authentication key that is generated by the ssh-keygen command. The public key can be copied to the remote servers by using the ssh-copy-id command or manually. The remote servers will use the public key to authenticate the user who has the corresponding private key (id_rsa). This will allow the user to log in without entering a password. The other options are incorrect because they are either private keys (id_rsa, id_dsa.pem, or id_ecdsa) or non-existent files (id_dsa.pem or id_ecdsa). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, page 410.
NEW QUESTION # 23
A Linux administrator is troubleshooting an issue in which an application service failed to start on a Linux server. The administrator runs a few commands and gets the following outputs:
Based on the above outputs, which of the following is the MOST likely action the administrator should take to resolve this issue?
- A. Update the KillSignal configuration for the logsearch.service to use TERM.
- B. Increase the TimeoutStartUSec configuration for the logsearch.sevice.
- C. Enable the logsearch.service and restart the service.
- D. Update the OnCalendar configuration to schedule the start of the logsearch.service.
Answer: B
Explanation:
Explanation
The administrator should increase the TimeoutStartUSec configuration for the logsearch.service to resolve the issue. The output of systemctl status logsearch.service shows that the service failed to start due to a timeout.
The output of cat /etc/systemd/system/logsearch.service shows that the service has a TimeoutStartUSec configuration of 10 seconds, which might be too short for the service to start. The administrator should increase this value to a higher number, such as 30 seconds or 1 minute, and then restart the service. The other options are incorrect because they are not related to the issue. The service is already enabled, as shown by the output of systemctl is-enabled logsearch.service. The service does not use an OnCalendar configuration, as it is not a timer unit. The service does not use a KillSignal configuration, as it is not being killed by a signal. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Processes and Scheduling Tasks, pages 434-435.
NEW QUESTION # 24
An administrator accidentally installed the httpd RPM package along with several dependencies. Which of the following options is the best way for the administrator to revert the package installation?
- A. apt-get clean
- B. dnf clean all
- C. yum history undo last
- D. rpm -e httpd
Answer: C
Explanation:
The yum history undo last command will undo the last transaction, which in this case is the installation of the httpd RPM package and its dependencies. This will remove the packages that were installed and restore the previous state of the system. See How to undo or redo yum transactions and yum history.
Reference
1: https://www.redhat.com/sysadmin/undo-redo-yum-transactions
2: https://man7.org/linux/man-pages/man8/yum.8.html#HISTORY
NEW QUESTION # 25
Which of the following data structures is written in JSON?
- A.

- B.

- C.

- D.

Answer: D
Explanation:
Option C is the only data structure that is written in JSON format. JSON stands for JavaScript Object Notation, and it is a lightweight and human-readable data interchange format. JSON uses curly braces to enclose objects, which consist of key-value pairs separated by commas. JSON uses square brackets to enclose arrays, which consist of values separated by commas. JSON supports six data types: strings, numbers, booleans, null, objects, and arrays. Option C follows these rules and syntax of JSON, while the other options do not. Option A is written in XML format, which uses tags to enclose elements and attributes. Option B is written in YAML format, which uses indentation and colons to define key-value pairs. Option D is written in INI format, which uses sections and equal signs to define key-value pairs. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 21: Automating Tasks with Ansible, page 591.
NEW QUESTION # 26
Following the migration from a disaster recovery site, a systems administrator wants a server to require a user to change credentials at initial login. Which of the following commands should be used to ensure the aging attribute?
- A. chage -d 0 user
- B. chage -d 1 user
- C. chage -E 0 user
- D. chage -d 2 user
Answer: A
Explanation:
The chage command can be used to change the user password expiry information. The -d or --lastday option sets the last password change date. If the value is 0, the user will be forced to change the password at the next login. See chage command in Linux with examples and 10 chage command examples in Linux.
NEW QUESTION # 27
A Linux administrator is restoring the SELinux contexts on an entire system. Which of the following commands is the BEST option to complete this task?
- A. setfacl -bR / && reboot
- B. restorecon / && reboot
- C. setenforce 0 && reboot
- D. touch /.autorelabel && reboot
Answer: D
Explanation:
As the .autorelabel file will force a RECURSIVE check of the whole system on boot whereas answer D lacks the -R flag that restorecon needs to work RECURSIVELY over the whole filesystem. Without -R it just works on a single file/dir.
NEW QUESTION # 28
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+D
- B. Ctrl+Z
- C. Ctrl+C
- D. Ctrl+F
Answer: C
Explanation:
Step-by-Step Comprehensive Detailed
Command
Ctrl+C sends a SIGINT (interrupt signal) to the foreground process, stopping its execution.
Why Other Options are Incorrect:
A: Ctrl+D signals the end-of-file (EOF) in a shell but does not stop processes.
B: Ctrl+F moves the cursor forward but does not affect processes.
C: Ctrl+Z suspends the process (sends it to the background) but does not stop it permanently.
Reference:
CompTIA Linux+ Training Materials, Signal Management
man signal
NEW QUESTION # 29
A developer has been unable to remove a particular data folder that a team no longer uses. The developer escalated the issue to the systems administrator. The following output was received:
Which of the following commands can be used to resolve this issue?
- A. chown -R data/
- B. chattr -R -i data/
- C. chmod -R 777 data/
- D. chgrp -R 755 data/
Answer: B
Explanation:
The command that can be used to resolve the issue of being unable to remove a particular data folder is chattr - R -i data/. This command will use the chattr utility to change file attributes on a Linux file system. The -R option means that chattr will recursively change attributes of directories and their contents. The -i option means that chattr will remove (unset) the immutable attribute from files or directories. When a file or directory has the immutable attribute set, it cannot be modified, deleted, or renamed.
The other options are not correct commands for resolving this issue. The chgrp -R 755 data/ command will change the group ownership of data/ and its contents recursively to 755, which is not a valid group name. The chgrp command is used to change group ownership of files or directories. The chmod -R 777 data/ command will change the file mode bits of data/ and its contents recursively to 777, which means that everyone can read, write, and execute them. However, this will not remove the immutable attribute, which prevents deletion or modification regardless of permissions. The chmod command is used to change file mode bits of files or directories. The chown -R data/ command is incomplete and will produce an error. The chown command is used to change the user and/or group ownership of files or directories, but it requires at least one argument besides the file name. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 7:
Managing Disk Storage; chattr(1) - Linux manual page; chgrp(1) - Linux manual page; chmod(1) - Linux manual page; chown(1) - Linux manual page
NEW QUESTION # 30
The users of a Linux system are unable to use one of the application filesystems. The following outputs have been provided:
Output 1:
bash
$ cd /app
$ touch file
touch: cannot touch 'file': Readonly file system
Output 2
/dev/sdcl on /app type ext4 (ro,relatime,seclabel,data=ordered)
Output 3
/dev/sdcl /app ext4 defaults 0 0
Output 4
[302.048075] Buffer I/O error on dev sdcl, logical block 0, async page
read [302.048490]
EXT4-fs (sdcl): Attempt to read block from filesystem resulted in short read while trying to re-open /dev/sdc1.
Which of the following actions will resolve this issue?
- A. fsck -y /dev/sdc1
mount -o rw,remount /app - B. umount /app
xfs_repair /dev/sdc1
mount /app - C. xfs_repair /dev/sdc1
mount -o rw,remount /app - D. umount /app
fsck -y /dev/sdcl
mount /app
Answer: A
Explanation:
The filesystem is in read-only mode, likely due to corruption or errors detected. Running fsck -y will check and repair the filesystem, and mount -o rw,remount will remount it as read-write, making it usable again. This is a common troubleshooting step for filesystems with errors.
NEW QUESTION # 31
A Linux engineer set up two local DNS servers (10.10.10.10 and 10.10.10.20) and was testing email connectivity to the local mail server using the mail command on a local machine when the following error appeared:
The local machine DNS settings are:
Which of the following commands could the engineer use to query the DNS server to get mail server information?
- A. dig @10.10.10.20 example.com ns
- B. dig @10.10.10.20 example.com mx
- C. dig @example.com 10.10.10.20 a
- D. dig @example.com 10.10.10.20 ptr
Answer: B
Explanation:
The command dig @10.10.10.20 example.com mx will query the DNS server to get mail server information.
The dig command is a tool for querying DNS servers and displaying the results. The @ option specifies the DNS server to query, in this case 10.10.10.20. The mx option specifies the type of record to query, in this case mail exchange (MX) records, which identify the mail servers for a domain. The domain name to query is example.com. This command will show the MX records for example.com from the DNS server 10.10.10.20.
This is the correct command to use to accomplish the task. The other options are incorrect because they either use the wrong syntax (@example.com 10.10.10.20 instead of @10.10.10.20 example.com), the wrong type of record (a or ptr instead of mx), or the wrong domain name (example.com ns instead of example.com mx). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, page 415.
NEW QUESTION # 32
A junior developer is unable to access an application server and receives the following output:
The systems administrator investigates the issue and receives the following output:
Which of the following commands will help unlock the account?
- A. pam_tally2 --user+dev2 --quiet
- B. pam_tally2 --user=dev2 --reset
- C. Pam_tally2 --user=dev2 --quiet
- D. pam_ tally2 --user=dev2
Answer: B
Explanation:
To unlock an account that has been locked due to login failures, the administrator can use the command pam_tally2 --user=dev2 --reset (D). This will reset the failure counter for the user"dev2" and allow the user to log in again. The other commands will not unlock the account, but either display or increase the failure count. References:
[CompTIA Linux+ Study Guide], Chapter 4: Managing Users and Groups, Section: Locking Accounts with pam_tally2
[How to Lock and Unlock User Account in Linux]
NEW QUESTION # 33
A Linux system is having issues. Given the following outputs:
# dig @192.168.2.2 mycomptiahost
; << >> DiG 9.9.4-RedHat-9.9.4-74.el7_6.1 << >> @192.168.2.2 mycomptiahost ; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached # nc -v 192.168.2.2 53 Ncat: Version 7.70 ( https://nmap.org/ncat ) Ncat: Connection timed out.
# ping 192.168.2.2
PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data. 64 bytes from 192.168.2.2: icmp_seq=1 ttl=117 time=4.94 ms 64 bytes from 192.168.2.2: icmp_seq=2 ttl=117 time=10.5 ms Which of the following best describes this issue?
- A. The Linux engineer is using the wrong DNS port.
- B. The name mycomptiahost does not exist in the DNS.
- C. The DNS host is down.
- D. The DNS service is currently not available or the corresponding port is blocked.
Answer: D
Explanation:
The ping command shows that the Linux system can reach the DNS server at 192.168.2.2, so the DNS host is not down. The dig and nc commands show that the Linux system cannot connect to the DNS server on port 53, which is the standard port for DNS queries. This means that either the DNS service is not running on the DNS server, or there is a firewall or network device blocking the port 53 traffic. Therefore, the DNS service is currently not available or the corresponding port is blocked.
NEW QUESTION # 34
......
100% Free XK0-005 Daily Practice Exam With 895 Questions: https://examsboost.realexamfree.com/XK0-005-real-exam-dumps.html

