ExamGecko
Home Home / CompTIA / XK0-005

CompTIA XK0-005 Practice Test - Questions Answers, Page 6

Question list
Search
Search

List of questions

Search

Related questions











An administrator is trying to diagnose a performance issue and is reviewing the following output:

System Properties:

CPU: 4 vCPU Memory: 40GB Disk maximum IOPS: 690 Disk maximum throughput: 44Mbps | 44000Kbps Based on the above output, which of the following BEST describes the root cause?

A.
The system has reached its maximum IOPS, causing the system to be slow.
A.
The system has reached its maximum IOPS, causing the system to be slow.
Answers
B.
The system has reached its maximum permitted throughput, therefore iowait is increasing.
B.
The system has reached its maximum permitted throughput, therefore iowait is increasing.
Answers
C.
The system is mostly idle, therefore the iowait is high.
C.
The system is mostly idle, therefore the iowait is high.
Answers
D.
The system has a partitioned disk, which causes the IOPS to be doubled.
D.
The system has a partitioned disk, which causes the IOPS to be doubled.
Answers
Suggested answer: B

Explanation:

The system has reached its maximum permitted throughput, therefore iowait is increasing. The output of iostat -x shows that the device sda has an average throughput of 44.01 MB/s, which is equal to the disk maximum throughput of 44 Mbps. The output also shows that the device sda has an average iowait of 99.99%, which means that the CPU is waiting for the disk to complete the I/O requests. This indicates that the disk is the bottleneck and the system is slow due to the high iowait.

The other options are incorrect because they are not supported by the outputs. The system has not reached its maximum IOPS, as the device sda has an average IOPS of 563.50, which is lower than the disk maximum IOPS of 690. The system is not mostly idle, as the output of top shows that the CPU is 100% busy. The system does not have a partitioned disk, as the output of lsblk shows that the device sda has only one partition sda1. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 17: Optimizing Linux Systems, pages 513-514.

A systems administrator wants to test the route between IP address 10.0.2.15 and IP address 192.168.1.40. Which of the following commands will accomplish this task?

A.
route -e get to 192.168.1.40 from 10.0.2.15
A.
route -e get to 192.168.1.40 from 10.0.2.15
Answers
B.
ip route get 192.163.1.40 from 10.0.2.15
B.
ip route get 192.163.1.40 from 10.0.2.15
Answers
C.
ip route 192.169.1.40 to 10.0.2.15
C.
ip route 192.169.1.40 to 10.0.2.15
Answers
D.
route -n 192.168.1.40 from 10.0.2.15
D.
route -n 192.168.1.40 from 10.0.2.15
Answers
Suggested answer: B

Explanation:

The command ip route get 192.168.1.40 from 10.0.2.15 will test the route between the IP address 10.0.2.15 and the IP address 192.168.1.40. The ip route get command shows the routing decision for a given destination and source address. This is the correct command to accomplish the task. The other options are incorrect because they either use the wrong commands (route instead of ip route), the wrong options (-e or -n instead of get), or the wrong syntax (to instead of from). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 12: Managing Network Connections, page 379.

A Linux administrator was tasked with deleting all files and directories with names that are contained in the sobelete.txt file. Which of the following commands will accomplish this task?

A.
xargs -f cat toDelete.txt -rm
A.
xargs -f cat toDelete.txt -rm
Answers
B.
rm -d -r -f toDelete.txt
B.
rm -d -r -f toDelete.txt
Answers
C.
cat toDelete.txt | rm -frd
C.
cat toDelete.txt | rm -frd
Answers
D.
cat toDelete.txt | xargs rm -rf
D.
cat toDelete.txt | xargs rm -rf
Answers
Suggested answer: D

Explanation:

The command cat toDelete.txt | xargs rm -rf will delete all files and directories with names that are contained in the toDelete.txt file. The cat command reads the file and outputs its contents to the standard output. The | operator pipes the output to the next command. The xargs command converts the output into arguments for the next command. The rm -rf command removes the files and directories recursively and forcefully. This is the correct way to accomplish the task. The other options are incorrect because they either use the wrong options (-f instead of -a for xargs), the wrong arguments (toDelete.txt instead of toDelete.txt filename for rm), or the wrong commands (rm instead of xargs). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11:

Managing Files and Directories, pages 349-350.

A Linux administrator is troubleshooting the root cause of a high CPU load and average.

Which of the following commands will permanently resolve the issue?

A.
renice -n -20 6295
A.
renice -n -20 6295
Answers
B.
pstree -p 6295
B.
pstree -p 6295
Answers
C.
iostat -cy 1 5
C.
iostat -cy 1 5
Answers
D.
kill -9 6295
D.
kill -9 6295
Answers
Suggested answer: D

Explanation:

The command that will permanently resolve the issue of high CPU load and average is kill -9 6295.

This command will send a SIGKILL signal to the process with the PID 6295, which is the process that is consuming 99.7% of the CPU according to the top output. The SIGKILL signal will terminate the process immediately and free up the CPU resources. The kill command is used to send signals to processes by PID or name.

The other options are not correct commands for resolving this issue. The renice -n -20 6295 command will change the priority (niceness) of the process with PID 6295 to -20, which is the highest priority possible. This will make the process more CPU-intensive, not less. The renice command is used to change the priority of running processes. The pstree -p 6295 command will show a tree of processes with PID 6295 as the root. This will not affect the CPU load or average, but only display information. The pstree command is used to display a tree of processes. The iostat -cy 1 5 command will show CPU and disk I/O statistics for 5 iterations with an interval of 1 second. This will also not affect the CPU load or average, but only display information. The iostat command is used to report CPU and I/O statistics. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Troubleshooting Linux Systems; kill(1) - Linux manual page; renice(1) - Linux manual page; pstree(1) -Linux manual page; iostat(1) - Linux manual page

A Linux administrator wants to set the SUID of a file named dev_team.text with 744 access rights.

Which of the following commands will achieve this goal?

A.
chmod 4744 dev_team.txt
A.
chmod 4744 dev_team.txt
Answers
B.
chmod 744 --setuid dev_team.txt
B.
chmod 744 --setuid dev_team.txt
Answers
C.
chmod -c 744 dev_team.txt
C.
chmod -c 744 dev_team.txt
Answers
D.
chmod -v 4744 --suid dev_team.txt
D.
chmod -v 4744 --suid dev_team.txt
Answers
Suggested answer: A

Explanation:

The command that will set the SUID of a file named dev_team.txt with 744 access rights is chmod 4744 dev_team.txt. This command will use the chmod utility to change the file mode bits of dev_team.txt. The first digit (4) represents the SUID bit, which means that when someone executes dev_team.txt, it will run with the permissions of the file owner. The next three digits (744) represent the read, write, and execute permissions for the owner (7), group (4), and others (4). This means that the owner can read, write, and execute dev_team.txt, while the group and others can only read it. The other options are not correct commands for setting the SUID of a file with 744 access rights. The chmod 744 --setuid dev_team.txt command is invalid because there is no --setuid option in chmod. The chmod -c 744 dev_team.txt command will change the file mode bits to 744, but it will not set the SUID bit. The -c option only means that chmod will report when a change is made. The chmod -v 4744 --suid dev_team.txt command is also invalid because there is no --suid option in chmod. The -v option only means that chmod will output a diagnostic for every file processed. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 8: Managing Users and Groups; chmod(1) - Linux manual page

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.
chgrp -R 755 data/
A.
chgrp -R 755 data/
Answers
B.
chmod -R 777 data/
B.
chmod -R 777 data/
Answers
C.
chattr -R -i data/
C.
chattr -R -i data/
Answers
D.
chown -R data/
D.
chown -R data/
Answers
Suggested answer: C

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. Reference: 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

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 load java:7
A.
docker image load java:7
Answers
B.
docker image pull java:7
B.
docker image pull java:7
Answers
C.
docker image import java:7
C.
docker image import java:7
Answers
D.
docker image build java:7
D.
docker image build java:7
Answers
Suggested answer: B

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. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Automating Tasks; docker image pull | Docker Docs

A cloud engineer is installing packages during VM provisioning. Which of the following should the engineer use to accomplish this task?

A.
Cloud-init
A.
Cloud-init
Answers
B.
Bash
B.
Bash
Answers
C.
Docker
C.
Docker
Answers
D.
Sidecar
D.
Sidecar
Answers
Suggested answer: A

Explanation:

The cloud engineer should use cloud-init to install packages during VM provisioning. Cloud-init is a tool that allows the customization of cloud instances at boot time. Cloud-init can perform various tasks, such as setting the hostname, creating users, installing packages, configuring network, and running scripts. Cloud-init can work with different cloud platforms and Linux distributions. This is the correct tool to accomplish the task. The other options are incorrect because they are either not suitable for cloud provisioning (Bash or Docker) or not a tool but a design pattern (Sidecar). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 563.

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.
Puppet
A.
Puppet
Answers
B.
Git
B.
Git
Answers
C.
Ansible
C.
Ansible
Answers
D.
Terraform
D.
Terraform
Answers
Suggested 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. This is the correct technology that the systems administrator used to complete the task. The other options are incorrect because they are either not designed for creating cloud servers (Puppet or Git) or not capable of assigning public IP addresses (Ansible). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 19: Managing Cloud and Virtualization Technologies, page 559.

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.
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
A.
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
Answers
B.
restorecon -R -v /var/www/html
B.
restorecon -R -v /var/www/html
Answers
C.
setenforce 0
C.
setenforce 0
Answers
D.
setsebool -P httpd_can_network_connect_db on
D.
setsebool -P httpd_can_network_connect_db on
Answers
Suggested answer: B

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. Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18: Securing Linux Systems, page 535.

Total 371 questions
Go to page: of 38