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

NameTypeDescription
-a, --alloptionInclude dot-prefixed entries, including . and ..
-1optionOne entry per line
--sort=WORDoptionSelect a supported sorting criterion
--optionEnd options
FILEoperandFile 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 .
Linux Reference