comptia xk0-005 practice test

CompTIA Linux+

page 1 out of 12

Viewing questions 1-15 out of 169


Question 1

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
  • B. rm -d -r -f toDelete.txt
  • C. cat toDelete.txt | rm -frd
  • D. cat toDelete.txt | xargs rm -rf
Answer:

b

Discussions
0 / 1000

Question 2

A systems administrator is tasked with mounting a USB drive on a system. The USB drive has a single partition, and it has been mapped by the system to the device /dev/sdb. Which of the following commands will mount the USB to /media/usb?

  • A. mount /dev/sdb1 /media/usb
  • B. mount /dev/sdb0 /media/usb
  • C. mount /dev/sdb /media/usb
  • D. mount -t usb /dev/sdb1 /media/usb
Answer:

a

Discussions
0 / 1000

Question 3

A Linux administrator needs to create a new user named user02. However, user02 must be in a different home directory, which is under /comptia/projects. Which of the following commands will accomplish this task?

  • A. useradd -d /comptia/projects user02
  • B. useradd -m /comptia/projects user02
  • C. useradd -b /comptia/projects user02
  • D. useradd -s /comptia/projects user02
Answer:

a

Discussions
0 / 1000

Question 4

Which of the following is a function of a bootloader?

  • A. It initializes all the devices that are required to load the OS.
  • B. It mounts the root filesystem that is required to load the OS.
  • C. It helps to load the different kernels to initiate the OS startup process.
  • D. It triggers the start of all the system services.
Answer:

a

Discussions
0 / 1000

Question 5

An administrator deployed a Linux server that is running a web application on port 6379/tcp.
SELinux is in enforcing mode based on organization policies.
The port is open on the firewall.
Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.
The administrator ran some commands that resulted in the following output:

Which of the following commands should be used to resolve the issue?

  • A. semanage port -d -t http_port_t -p tcp 6379
  • B. semanage port -a -t http_port_t -p tcp 6379
  • C. semanage port -a http_port_t -p top 6379
  • D. semanage port -l -t http_port_tcp 6379
Answer:

b

Discussions
0 / 1000

Question 6

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 @example.com 10.10.10.20 a
  • B. dig @10.10.10.20 example.com mx
  • C. dig @example.com 10.10.10.20 ptr
  • D. dig @10.10.10.20 example.com ns
Answer:

b

Discussions
0 / 1000

Question 7

A systems administrator needs to reconfigure a Linux server to allow persistent IPv4 packet forwarding. Which of the following commands is the correct way to accomplish this task?

  • A. echo 1 > /proc/sys/net/ipv4/ipv_forward
  • B. sysctl -w net.ipv4.ip_forward=1
  • C. firewall-cmd --enable ipv4_forwarding
  • D. systemctl start ipv4_forwarding
Answer:

b

Discussions
0 / 1000

Question 8

A developer reported an incident involving the application configuration file /etc/httpd/conf/httpd.conf that is missing from the server. Which of the following identifies the RPM package that installed the configuration file?

  • A. rpm -qf /etc/httpd/conf/httpd.conf
  • B. rpm -ql /etc/httpd/conf/httpd.conf
  • C. rpm --query /etc/httpd/conf/httpd.conf
  • D. rpm -q /etc/httpd/conf/httpd.conf
Answer:

a

Discussions
0 / 1000

Question 9

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

  • A. Cloud-init
  • B. Bash
  • C. Docker
  • D. Sidecar
Answer:

a

Discussions
0 / 1000

Question 10

A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?

  • A. podman run -d -p 443:8443 httpd
  • B. podman run -d -p 8443:443 httpd
  • C. podman run d -e 443:8443 httpd
  • D. podman exec -p 8443:443 httpd
Answer:

a

Discussions
0 / 1000

Question 11

A systems administrator is troubleshooting connectivity issues and trying to find out why a Linux server is not able to reach other servers on the same subnet it is connected to. When listing link parameters, the following is presented:

Based on the output above, which of following is the MOST probable cause of the issue?

  • A. The address ac:00:11:22:33:cd is not a valid Ethernet address.
  • B. The Ethernet broadcast address should be ac:00:11:22:33:ff instead.
  • C. The network interface eth0 is using an old kernel module.
  • D. The network interface cable is not connected to a switch.
Answer:

d

Discussions
0 / 1000

Question 12

A systems administrator is tasked with setting up key-based SSH authentication. In which of the following locations should the administrator place the public keys for the server?

  • A. ~/.sshd/authkeys
  • B. ~/.ssh/keys
  • C. ~/.ssh/authorized_keys
  • D. ~/.ssh/keyauth
Answer:

c

Discussions
0 / 1000

Question 13

A systems administrator is notified that the mysqld process stopped unexpectedly. The systems administrator issues the following command:

sudo grep i -r out of memory /var/log
The output of the command shows the following:
kernel: Out of memory: Kill process 9112 (mysqld) score 511 or sacrifice child.
Which of the following commands should the systems administrator execute NEXT to troubleshoot this issue? (Select two).

  • A. free -h
  • B. nc -v 127.0.0.1 3306
  • C. renice -15 $( pidof mysql )
  • D. lsblk
  • E. killall -15
  • F. vmstat -a 1 4
Answer:

ac

Discussions
0 / 1000

Question 14

A systems administrator was tasked with assigning the temporary IP address/netmask 192.168.168.1/255.255.255.255 to the interface eth0 of a Linux server.
When adding the address, the following error appears:
# ip address add 192.168.168.1/33 dev eth0
Error: any valid prefix is expected rather than 192.168.168.1/33.
Based on the command and its output above, which of the following is the cause of the issue?

  • A. The CIDR value /33 should be /32 instead.
  • B. There is no route to 192.168.168.1/33.
  • C. The interface eth0 does not exist.
  • D. The IP address 192.168.168.1 is already in use.
Answer:

c

Discussions
0 / 1000

Question 15

Based on an organizations new cybersecurity policies, an administrator has been instructed to ensure that, by default, all new users and groups that are created fall within the specified values below.

To which of the following configuration files will the required changes need to be made?

  • A. /etc/login.defs
  • B. /etc/security/limits.conf
  • C. /etc/default/useradd
  • D. /etc/profile
Answer:

c

Discussions
0 / 1000
To page 2