Courseiva
easyMultiple SelectObjective-mapped

XK0-006 Practice Question: A security administrator needs to verify the…

A security administrator needs to verify the SELinux context of files in a directory. Which TWO commands can be used? (Choose two.)

⚠ Common exam trap

Many exam-takers confuse `ls -Z` and `ps -Z` because both use the `-Z` flag, but `ps -Z` applies to processes, not files, leading to an incorrect selection.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

ls -Z

The `ls -Z` command displays the SELinux security context of files in a directory, showing the user, role, type, and sensitivity level. The `stat -Z` command also retrieves the SELinux context along with other file metadata, making both commands valid for verifying SELinux contexts.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • getenforce

    Why it's wrong here

    Shows the current SELinux enforcing mode, not file context.

  • ps -Z

    Why it's wrong here

    Displays SELinux context for processes, not files.

  • ls -Z

    Why this is correct

    Lists files with their SELinux security context.

  • stat -Z

    Why this is correct

    Displays file status including SELinux security context.

  • chcon

    Why it's wrong here

    Changes the SELinux context, does not display it.

About these practice questions

This XK0-006 question is part of Courseiva's 979-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.