commands
ls — list directory entries
GNU ls lists directory entries or describes named files; no operands defaults to the working directory. Dot-prefixed entries are normally omitted. Use -- before option-like filenames. Output varies with locale and terminal settings; do not parse ls as a reliable filename transport.
Formal Syntax & Structure
linux syntaxlinux
ls [OPTION]... [FILE]...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -a, --all | option | Include dot-prefixed entries, including . and .. |
| -1 | option | One entry per line |
| --sort=WORD | option | Select a supported sorting criterion |
| -- | option | End options |
| FILE | operand | File or directory to list |
Return Value
text and exit status
GNU ls returns 0 on success, 1 for minor problems and 2 for serious problems; consult the exact version.
Working Example
Example Snippetlinux
ls -1 --all .