010-160 · Question #85
Which command displays file names only and no additional information?
The correct answer is A. ls -a. The ls command without format flags displays only file names, and -a adds hidden files to that output without adding detail columns.
Question
Options
- Als -a
- Bls -lh
- Cls -l
- Dls -alh
- Els -nl
How the community answered
(42 responses)- A88% (37)
- B2% (1)
- C5% (2)
- D5% (2)
Why each option
The ls command without format flags displays only file names, and -a adds hidden files to that output without adding detail columns.
The ls -a flag lists all files including hidden files (those prefixed with a dot) but does not enable long format output, so only file names are shown with no permissions, timestamps, or size information. Without the -l flag, ls output remains a simple name listing regardless of other flags like -a.
The -l and -h flags together produce long format output with human-readable sizes, showing permissions, ownership, size, and timestamps.
The -l flag enables long format output, displaying detailed metadata columns such as permissions, link count, owner, group, size, and modification date.
Combining -a, -l, and -h produces long format output for all files including hidden ones, showing full metadata alongside each file name.
The -n flag is a variant of long format (-l) that displays numeric UID and GID values instead of names, still showing all detail columns.
Concept tested: Linux ls command output format flags
Source: https://man7.org/linux/man-pages/man1/ls.1.html
Topics
Community Discussion
No community discussion yet for this question.