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?
This is the standard command to view permissions, owner, and group in a concise format.
Why this answer
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.
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.
How to eliminate wrong answers
Option A is wrong because 'stat' shows detailed file metadata (inode, timestamps, etc.) but does not display permissions and ownership in a concise, human-readable format like 'ls -l'. Option C is wrong because 'file' determines the file type (e.g., ELF binary, script) but does not show permissions or ownership. Option D is wrong because 'chmod' is used to change permissions, not to view them; running it without a mode argument will produce an error.