easyMultiple SelectObjective-mapped
XK0-006 Practice Question: Which two commands can be used to view the…
Which two commands can be used to view the SELinux context of files or processes?
⚠ Common exam trap
Many exam-takers confuse commands that change SELinux contexts or modes (chcon, setenforce) with those that display contexts, or they may think `getenforce` shows context details when it only shows the enforcement state.
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
✓
ps auxZ
`ps auxZ` displays the SELinux context for each running process, showing the user, role, type, and sensitivity level associated with the process. Option E is correct because `ls -Z` shows the SELinux context of files and directories, including the security label that defines access controls. Both commands are standard Linux utilities that expose the SELinux security context attribute.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
chcon
Why it's wrong here
chcon changes the SELinux context, it does not display it.
- ✗
getenforce
Why it's wrong here
getenforce shows whether SELinux is enforcing, permissive, or disabled, not contexts.
- ✗
setenforce
Why it's wrong here
setenforce changes the enforcement mode, it does not display contexts.
- ✓
ps auxZ
Why this is correct
ps auxZ displays the SELinux context of processes.
- ✓
ls -Z
Why this is correct
ls -Z displays the SELinux context of files.
Go deeper
Related to this question
Learn chapter
Linux Fundamentals and History
Key term
Process
In IT service management, a process is a structured set of activities designed to accomplish a specific objective, such as managing incidents or changes, by transforming inputs into defined outputs.
Key term
Linux
Linux is an open-source operating system that manages computer hardware and software, widely used in servers, desktops, and embedded systems.
About these practice questions
One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
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.