mediumMultiple Choice
220-1102 Practice Question: A user cannot run a command because they get…
A user cannot run a command because they get 'permission denied' even though they are in the sudoers file. The command is located in /opt/custom/bin. Which command will list the file in long format, showing its permissions, owner, group, size, and modification date?
⚠ Common exam trap
CompTIA often tests the distinction between viewing permissions ('ls -l' or 'stat') and modifying them ('chmod'), and candidates may confuse 'file' (type detection) with 'ls -l' (permission display). The question specifies a long-format listing, which 'stat' does not produce; only 'ls -l' meets that requirement.
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 -l /opt/custom/bin/command
The 'ls -l' command displays the file's permissions (e.g., -rwxr-xr-x), ownership (user and group), and other metadata in a long-format listing. This directly shows whether the file is executable and who owns it, which is essential for diagnosing a 'permission denied' error despite sudoers membership. While 'stat' also reports permissions and ownership, it does not produce a long-format listing, so it does not satisfy the question's requirement.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
stat /opt/custom/bin/command
Why it's wrong here
stat shows detailed metadata but is less commonly used for quick permission checks; it is correct but not the standard tool.
- ✓
ls -l /opt/custom/bin/command
Why this is correct
This is the standard command to view permissions, owner, and group in a concise format.
- ✗
file /opt/custom/bin/command
Why it's wrong here
file shows the file type, not permissions or ownership.
- ✗
chmod /opt/custom/bin/command
Why it's wrong here
chmod changes permissions, it does not display them.
Go deeper
Related to this question
About these practice questions
Courseiva writes every 220-1202 question from scratch — 687 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 220-1202 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 220-1202 exam.