Free XK0-006 Exam Braindumps
CompTIA Linux+ Questions 25–32 (page: 5)

Updated On: 30-Apr-2026

A user on a Linux VM is running /work/test.sh Bash script and receives the following error:

bash: /work/test.sh: Permission denied

After further investigation, the user receives the following outputs:



Which of the following commands should a systems administrator run to fix the issue?

  1. mount -o remount,exec /work
  2. mount -o remount,suid /work
  3. chmod g+x /work/test.sh
  4. chmod o+x /work/test.sh

Answer(s): A

Explanation:

The script /work/test.sh already has execute permissions (-rwxr--r--), but the filesystem is mounted with the noexec option, which prevents execution of binaries and scripts. Remounting the filesystem with the exec option allows execution of the script.



A systems administrator needs to set the IP address of a new DNS server. Which of the following files should the administrator modify to complete this task?

  1. /etc/whois.conf
  2. /etc/resolv.conf
  3. /etc/nsswitch.conf
  4. /etc/dnsmasq.conf

Answer(s): B

Explanation:

The /etc/resolv.conf file defines DNS resolver settings, including the IP addresses of DNS servers that the system should use for hostname resolution.



Following the completion of monthly server patching, a Linux administrator receives reports that a critical application is not functioning. Which of the following commands should help the administrator determine which packages were installed?

  1. dnf history
  2. dnf list
  3. dnf info
  4. dnf search

Answer(s): A

Explanation:

The dnf history command shows a log of past package operations (install, update, remove), allowing the administrator to review which packages were installed or updated during the patching process.



A Linux administrator wants to make the ENABLE_AUTH variable set to 1 and available to the environment of subsequently executed commands. Which of the following should the administrator use for this task?

  1. let ENABLE_AUTH=1
  2. ENABLE_AUTH=1
  3. ENABLE_AUTH=$(echo $ENABLE_AUTH)
  4. export ENABLE_AUTH=1

Answer(s): D

Explanation:

The export command sets an environment variable and makes it available to subsequently executed commands and child processes, ensuring ENABLE_AUTH=1 is recognized system-wide in that shell session.



A Linux administrator wants to use AI to deploy infrastructure as code. Which of the following is a best practice regarding the use of AI for this task?

  1. Using copy and paste when possible
  2. Generating monolithic code
  3. Linting generated code
  4. Merging CI/CD pipelines

Answer(s): C

Explanation:

Linting ensures that AI-generated infrastructure-as-code (IaC) follows proper syntax, formatting, and best practices. This helps prevent errors, enforces consistency, and improves security before deployment.



Which of the following passwords is the most complex?

  1. H3sa1dt01d
  2. he$@ID$heTold
  3. H3s@1dSh3t0|d
  4. HeSaidShetold

Answer(s): C

Explanation:

This password is the most complex because it uses uppercase and lowercase letters, numbers, and multiple special characters, making it significantly harder to guess or brute-force compared to the others.



A systems administrator needs to write a script that counts the number of times "FAIL" appears in a log file. If "FAIL" appears zero times, then the administrator would like to print the message "SUCCESS." Given the following:



Which of the following should be used before the zero to complete the script?

  1. -ne
  2. -gt
  3. -lt
  4. -eq

Answer(s): D

Explanation:

The test should check if the count of "FAIL" equals zero. The operator -eq is used for numeric equality in shell conditionals, so [ $(grep -c FAIL /var/file.log) -eq 0 ] correctly evaluates whether the count is zero.



An administrator receives the following output while attempting to unmount a filesystem:

umount /data1: target is busy.

Which of the following commands should the administrator run next to determine why the filesystem is busy?

  1. ps -f /data1
  2. du -sh /data1
  3. top -d /data1
  4. lsof | grep /data1

Answer(s): D

Explanation:

The lsof command lists open files and the processes using them. Running lsof | grep /data1 will show which processes are keeping the /data1 filesystem busy, preventing it from being unmounted.



Viewing page 5 of 19
Viewing questions 33 - 40 out of 160 questions


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

AI Tutor AI Tutor 👋 I’m here to help!