Difficulty: Easy
Correct Answer: ls -x
Explanation:
Introduction / Context:
Directory listings can be tailored to different needs. When scanning many filenames quickly, a compact multi-column listing helps maximize screen real estate. The ls utility provides flags to adjust layout, sorting, and detail level.
Given Data / Assumptions:
Concept / Approach:
ls without options may choose a default multi-column format, but behavior varies by environment variables and aliases. The option -x explicitly sorts entries across, then down, and displays them in multiple columns, producing a dense, readable layout. In contrast, -1 forces one entry per line, and -l shows a detailed long listing.
Step-by-Step Solution:
Verification / Alternative check:
Compare outputs of ls, ls -1, and ls -x to confirm that -x is providing the intended multi-column across display consistently regardless of defaults or aliases.
Why Other Options Are Wrong:
a: ls alone may be multi-column but is not guaranteed; the question asks for a command that ensures multiple columns.
b: ls -1 forces one item per line.
d: lc is not a standard command.
e: Not applicable; ls -x is the correct explicit choice.
Common Pitfalls:
Relying on default ls aliases that already add options; forgetting to use -a when hidden files should appear; mixing -x with -l (they conflict in layout goals).
Final Answer:
ls -x
Discussion & Comments