LINUX COMMAND ATLAS · COMMAND GUIDE
Linux ls command
List files and folders. Add flags to show hidden files and details.
GNU Coreutils
Syntax
Command form
ls [OPTION]... [FILE]...
Common options
12 options
| Option | What it does |
|---|
-a, --all | Include names beginning with a dot. |
|---|
-A, --almost-all | Include hidden names, except . and ... |
|---|
-l | Use a long listing with permissions, owner, size and time. |
|---|
-h, --human-readable | With -l, show sizes in readable units. |
|---|
-R, --recursive | List subdirectories recursively. |
|---|
-t | Sort by modification time, newest first. |
|---|
-r, --reverse | Reverse the selected sort order. |
|---|
-S | Sort by file size, largest first. |
|---|
-d, --directory | List directories themselves, not their contents. |
|---|
-F, --classify | Append a type marker such as / to directories. |
|---|
--color[=WHEN] | Control coloured output: always, never or auto. |
|---|
--time-style=STYLE | Choose the timestamp format in long listings. |
|---|
Usage examples
3 examples
List files and folders. Add flags to show hidden files and details.
ls -lah
Show hidden entries and readable file sizes in long format.
ls -lah /var/log
Sort by newest modification time using an ISO-like date format.
ls -lt --time-style=long-iso
Notes
GNU ls has many options; output and available flags can differ on BSD and minimal systems.