Free CompTIA XK0-006 Exam Questions (page: 8)

An administrator needs to verify the user ID, home directory, and assigned shell for the user named "accounting." Which of the following commands should the administrator use to retrieve this information?

  1. qetent passwd accounting
  2. id accounting
  3. grep accounting /etc/shadow
  4. who accounting

Answer(s): A

Explanation:

The getent passwd accounting command retrieves the user's entry from the system's password database, showing fields such as username, UID, GID, home directory, and assigned shell.



A Linux user needs to download the latest Debian image from a Docker repository.
Which of the following commands makes this task possible?

  1. docker image init debian
  2. docker image pull Debian
  3. docker image import debian
  4. docker image save debian

Answer(s): B

Explanation:

The docker image pull command downloads an image from a Docker repository (such as Docker Hub). Using docker image pull debian retrieves the latest Debian image.



In the echo "profile-$num-$name" line of a shell script, the variable $num seems to not be expanding during execution.
Which of the following notations ensures the value is expanded?

  1. echo "profile-$(num)-$name"
  2. echo 'profile-$num-$name'
  3. echo "profile-`Snum`-$name"
  4. echo "profile-${num}-$name"

Answer(s): D

Explanation:

Using ${num} ensures correct variable expansion, especially when variables are adjacent to other characters or hyphens. This prevents ambiguity and guarantees $num is properly expanded within the string.



A systems administrator wants to review the logs from an Apache 2 error.log file in real time and save the information to another file for later review.
Which of the following commands should the administrator use?

  1. tail -f /var/log/apache2/error.log > logfile.txt
  2. tail -f /var/log/apache2/error.log | logfile.txt
  3. tail -f /var/log/apache2/error.log >> logfile.txt
  4. tail -f /var/log/apache2/error.log | tee logfile.txt

Answer(s): D

Explanation:

Using tee allows output to be viewed in real time on the terminal while simultaneously writing it to logfile.txt. This meets both requirements: monitoring live updates and saving them for later review.



Which of the following describes the method of consolidating system events to a single location?

  1. Log aggregation
  2. Health checks
  3. Webhooks
  4. Threshold monitoring

Answer(s): A

Explanation:

Log aggregation is the process of collecting and consolidating logs from multiple sources into a single location, making it easier to analyze and manage system events.



Viewing page 8 of 16
Viewing questions 36 - 40 out of 71 questions



Post your Comments and Discuss CompTIA XK0-006 exam prep with other Community members:

XK0-006 Exam Discussions & Posts