# man > ls

---
type: CommandReference
command: ls
mode: man
section: "1"
source: man-pages
---

## Quick Reference
- `ls -1` — List one file per line
- `ls -a` — List all files, including hidden
- `ls -F` — Append indicator to entries (directory/, symbolic_link@...)
- `ls -la` — Long format with all files
- `ls -lh` — Long format with human-readable sizes
- `ls -lS` — Long format, sorted by size descending
- `ls -ltr` — Long format, sorted by modification time, reversed (oldest first)
- `ls -d */` — List only directories

## Name
ls — list directory contents

## Synopsis
`ls [OPTION]... [FILE]...`

## Options

### Output Format
- `-1` — List one file per line
- `-C` — List entries by columns, sorted vertically
- `-m` — Fill width with a comma-separated list of entries
- `-x` — List entries by lines instead of by columns
- `-l` — Use a long listing format (permissions, ownership, size, date/time)
- `-g` — Like `-l`, but omit the owner
- `-o` — Like `-l`, but omit group information
- `-G, --no-group` — In a long listing, do not print group names
- `-n, --numeric-uid-gid` — Like `-l`, but display numeric user and group IDs
- `-h, --human-readable` — With `-l` and `-s`, print sizes like 1K, 234M (powers of 1024)
- `--si` — Like `-h`, but use powers of 1000
- `-s, --size` — Print the allocated size of each file, in blocks
- `-S` — Sort by file size, largest first (used with or without `-l`)
- `-F, --classify` — Append indicator: `*` for executables, `/` for directories, `@` for symlinks, `|` for FIFOs, `=` for sockets
- `--file-type` — Like `-F`, but do not append `*`
- `-p` — Append `/` indicator to directories
- `--indicator-style=WORD` — none (default), slash (`-p`), file-type (`--file-type`), classify (`-F`)
- `-i, --inode` — Print the inode number of each file
- `-Z, --context` — Print any SELinux security context of each file
- `-k, --kibibytes` — Use 1024-byte blocks for disk usage; used only with `-s` and per directory totals
- `--author` — With `-l`, print the author of each file

### Sorting
- `-t` — Sort by modification time, newest first
- `-u` — With `-lt`: sort by, and show, access time; with `-l`: show access time and sort by name; otherwise: sort by access time, newest first
- `-c` — With `-lt`: sort by, and show, ctime (status change); with `-l`: show ctime and sort by name; otherwise: sort by ctime, newest first
- `-U` — Do not sort; list entries in directory order
- `-v` — Natural sort of (version) numbers within text
- `-X` — Sort alphabetically by entry extension
- `-r, --reverse` — Reverse the sort order
- `--sort=WORD` — Sort by WORD instead of name: none (`-U`), size (`-S`), time (`-t`), version (`-v`), extension (`-X`)

### Time Display
- `--time=WORD` — Change the default of using modification times. WORD: `atime`, `access`, `use` (access time); `ctime`, `status` (change time); `birth`, `creation` (birth time). With `-l`, determines which time to show; with `--sort=time`, sort by that time.
- `--time-style=TIME_STYLE` — Time/date format with `-l`. Values: `full-iso`, `long-iso`, `iso`, `locale`, or `+FORMAT` (interpreted like `date(1)`)
- `--full-time` — Same as `-l --time-style=full-iso`

### Filtering & Recursion
- `-a, --all` — Do not ignore entries starting with `.`
- `-A, --almost-all` — Like `-a`, but omit implied `.` and `..`
- `-B, --ignore-backups` — Do not list entries ending with `~`
- `-I, --ignore=PATTERN` — Do not list entries matching shell PATTERN
- `--hide=PATTERN` — Like `-I`, but overridden by `-a` or `-A`
- `-d, --directory` — List directories themselves, not their contents
- `-R, --recursive` — List subdirectories recursively
- `--group-directories-first` — Group directories before files; use of `--sort=none` (`-U`) disables this

### Symbolic Links
- `-L, --dereference` — Follow symbolic links when showing information
- `-H` — Follow symbolic links listed on the command line
- `--dereference-command-line-symlink-to-dir` — Follow each command-line symlink that points to a directory

### Quoting & Control Characters
- `-b, --escape` — Print C-style escapes for non‑graphic characters
- `-q, --hide-control-chars` — Print `?` instead of non‑graphic characters
- `--show-control-chars` — Show non‑graphic characters as‑is (default unless output is a terminal)
- `-N, --literal` — Print entry names without quoting
- `-Q, --quote-name` — Enclose entry names in double quotes
- `--quoting-style=WORD` — Quoting style: `literal`, `locale`, `shell`, `shell-always`, `shell-escape`, `shell-escape-always`, `c`, `escape`

### Appearance & Width
- `--color[=WHEN]` — Colorize output; WHEN: `always`, `auto`, `never`
- `-w, --width=COLS` — Set output width. 0 means no limit
- `-T, --tabsize=COLS` — Assume tab stops at each COLS instead of 8
- `--hyperlink[=WHEN]` — Hyperlink file names; WHEN: `always`, `auto`, `never`

### Size & Block Scaling
- `--block-size=SIZE` — With `-l`, scale sizes by SIZE (e.g., `--block-size=M`). SIZE is an integer and optional unit: K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, … (powers of 1000). Binary prefixes: KiB = K, MiB = M, etc.

### Help & Version
- `--help` — Display help and exit
- `--version` — Output version information and exit

## See Also
- Full documentation: [GNU coreutils ls](https://www.gnu.org/software/coreutils/ls)
- Online manual: `info '(coreutils) ls invocation'`
- [date(1)](http://localhost/phpMan.php/man/date/1/markdown) (for `+FORMAT` syntax)

## Exit Codes
- `0` — Success
- `1` — Minor problems (e.g., cannot access subdirectory)
- `2` — Serious trouble (e.g., cannot access command-line argument)