Difficulty: Easy
Correct Answer: ls -F -x
Explanation:
Introduction / Context:
The ls
command supports many options for formatting and annotation. For quick visual classification of entries and compact multi-column listing, certain flags can be combined to improve readability in wide terminals.
Given Data / Assumptions:
ls
implementation supporting -F
and -x
.
Concept / Approach:-F
appends a character to each entry indicating its type (e.g., /
for directories, *
for executables, @
for symlinks). -x
prints entries in rows across the screen (multi-column), contrasting with -l
, which is long, single-column output.
Step-by-Step Solution:
Run ls -F -x
in a directory with mixed content.Observe multi-column output and appended indicators.Use ls -F
alone for single-column indicators or ls -x
alone for multi-column without indicators.
Verification / Alternative check:
Compare with ls -l
(detailed single-column) and ls -C
(multi-column by column). Some platforms combine flags differently; --classify
is a GNU synonym for -F
.
Why Other Options Are Wrong:ls -l
(Option B) shows a long listing, not multi-column.ls ~ x
(Option C) is invalid syntax.Option D appears to be a mistyped command.
Common Pitfalls:
-x
with -X
(sort by extension on some systems).
Final Answer:
ls -F -x
Discussion & Comments