# ls.1

list directory contents

## Sections

- [Examples (TL;DR)](https://www.mankier.com/1/ls#Examples_(TL;DR)), id: Examples_(TL;DR)
- [Synopsis](https://www.mankier.com/1/ls#Synopsis), id: Synopsis
- [Description](https://www.mankier.com/1/ls#Description), id: Description
  - [Exit status](https://www.mankier.com/1/ls#Description-Exit_status), id: Description-Exit_status
- [Author](https://www.mankier.com/1/ls#Author), id: Author
- [Reporting Bugs](https://www.mankier.com/1/ls#Reporting_Bugs), id: Reporting_Bugs
- [Copyright](https://www.mankier.com/1/ls#Copyright), id: Copyright
- [See Also](https://www.mankier.com/1/ls#See_Also), id: See_Also
- [Referenced By](https://www.mankier.com/1/ls#Referenced_By), id: Referenced_By


## Anchors

[**-1**](https://www.mankier.com/1/ls#-1)

:   list one file per line

[**-a, --all**](https://www.mankier.com/1/ls#-a)

:   do not ignore entries starting with .

[**-A, --almost-all**](https://www.mankier.com/1/ls#-A)

:   do not list implied . and ..

[**--author**](https://www.mankier.com/1/ls#--author)

:   with **-l**, print the author of each file

[**-b, --escape**](https://www.mankier.com/1/ls#-b)

:   print C-style escapes for nongraphic characters

[**-B, --ignore-backups**](https://www.mankier.com/1/ls#-B)

:   do not list implied entries ending with ~

[**--block-size=SIZE**](https://www.mankier.com/1/ls#--block-size)

:   with **-l**, scale sizes by SIZE when printing them; e.g.,
    '--block-size=M'; see SIZE format below

[**--color\[=WHEN\]**](https://www.mankier.com/1/ls#--color)

:   color the output WHEN; more info below

[**-c**](https://www.mankier.com/1/ls#-c)

:   with **-lt**: sort by, and show, ctime (time of last change of file
    status information); with **-l**: show ctime and sort by name;
    otherwise: sort by ctime, newest first

[**-C**](https://www.mankier.com/1/ls#-C)

:   list entries by columns

[**-d, --directory**](https://www.mankier.com/1/ls#-d)

:   list directories themselves, not their contents

[**-D, --dired**](https://www.mankier.com/1/ls#-D)

:   generate output designed for Emacs' dired mode

[**--dereference-command-line-symlink-to-dir**](https://www.mankier.com/1/ls#--dereference-command-line-symlink-to-dir)

:   follow each command line symbolic link that points to a directory

[**-F, --classify\[=WHEN\]**](https://www.mankier.com/1/ls#-F)

:   append indicator (one of \*/=\>@\|) to entries WHEN

[**--file-type**](https://www.mankier.com/1/ls#--file-type)

:   like **-F**, except do not append '\*'

[**--format=WORD**](https://www.mankier.com/1/ls#--format)

:   across,horizontal (**-x**), commas (**-m**), long (**-l**),
    single-column (**-1**), verbose (**-l**), vertical (**-C**)

[**-f**](https://www.mankier.com/1/ls#-f)

:   same as **-a** **-U**

[**--full-time**](https://www.mankier.com/1/ls#--full-time)

:   like **-l** **--time-style**=*full-iso*

[**-G, --no-group**](https://www.mankier.com/1/ls#-G)

:   in a long listing, don't print group names

[**--group-directories-first**](https://www.mankier.com/1/ls#--group-directories-first)

:   group directories before files

[**-g**](https://www.mankier.com/1/ls#-g)

:   like **-l**, but do not list owner

[**-H, --dereference-command-line**](https://www.mankier.com/1/ls#-H)

:   follow symbolic links listed on the command line

[**--help**](https://www.mankier.com/1/ls#--help)

:   display this help and exit

[**-h, --human-readable**](https://www.mankier.com/1/ls#-h)

:   with **-l** and **-s**, print sizes like 1K 234M 2G etc.

[**--hide=PATTERN**](https://www.mankier.com/1/ls#--hide)

:   do not list implied entries matching shell PATTERN (overridden by
    **-a** or **-A**)

[**--hyperlink\[=WHEN\]**](https://www.mankier.com/1/ls#--hyperlink)

:   hyperlink file names WHEN

[**-I, --ignore=PATTERN**](https://www.mankier.com/1/ls#-I)

:   do not list implied entries matching shell PATTERN

[**-i, --inode**](https://www.mankier.com/1/ls#-i)

:   print the index number of each file

[**--indicator-style=WORD**](https://www.mankier.com/1/ls#--indicator-style)

:   append indicator with style WORD to entry names: none (default),
    slash (**-p**), file-type (**--file-type**), classify (**-F**)

[**-k, --kibibytes**](https://www.mankier.com/1/ls#-k)

:   default to 1024-byte blocks for file system usage; used only with
    **-s** and per directory totals

[**-L, --dereference**](https://www.mankier.com/1/ls#-L)

:   when showing file information for a symbolic link, show information
    for the file the link references rather than for the link itself

[**-l**](https://www.mankier.com/1/ls#-l)

:   use a long listing format

[**-m**](https://www.mankier.com/1/ls#-m)

:   fill width with a comma separated list of entries

[**-N, --literal**](https://www.mankier.com/1/ls#-N)

:   print entry names without quoting

[**-n, --numeric-uid-gid**](https://www.mankier.com/1/ls#-n)

:   like **-l**, but list numeric user and group IDs

[**-o**](https://www.mankier.com/1/ls#-o)

:   like **-l**, but do not list group information

[**-p, --indicator-style=slash**](https://www.mankier.com/1/ls#-p)

:   append / indicator to directories

[**-q, --hide-control-chars**](https://www.mankier.com/1/ls#-q)

:   print ? instead of nongraphic characters

[**-Q, --quote-name**](https://www.mankier.com/1/ls#-Q)

:   enclose entry names in double quotes

[**--quoting-style=WORD**](https://www.mankier.com/1/ls#--quoting-style)

:   use quoting style WORD for entry names: literal, locale, shell,
    shell-always, shell-escape, shell-escape-always, c, escape
    (overrides QUOTING_STYLE environment variable)

[**-R, --recursive**](https://www.mankier.com/1/ls#-R)

:   list subdirectories recursively

[**-r, --reverse**](https://www.mankier.com/1/ls#-r)

:   reverse order while sorting

[**--show-control-chars**](https://www.mankier.com/1/ls#--show-control-chars)

:   show nongraphic characters as-is; the default, unless program is
    'ls' and output is a terminal

[**--si**](https://www.mankier.com/1/ls#--si)

:   likewise, but use powers of 1000 not 1024

[**--sort=WORD**](https://www.mankier.com/1/ls#--sort)

:   change default 'name' sort to WORD: none (**-U**), size (**-S**),
    time (**-t**), version (**-v**), extension (**-X**), name, width

[**-s, --size**](https://www.mankier.com/1/ls#-s)

:   print the allocated size of each file, in blocks

[**-S**](https://www.mankier.com/1/ls#-S)

:   sort by file size, largest first

[**--time-style=TIME_STYLE**](https://www.mankier.com/1/ls#--time-style)

:   time/date format with **-l**; see TIME_STYLE below

[**--time=WORD**](https://www.mankier.com/1/ls#--time)

:   select which timestamp used to display or sort; access time
    (**-u**): atime, access, use; metadata change time (**-c**): ctime,
    status; modified time (default): mtime, modification; birth time:
    birth, creation; with **-l**, WORD determines which time to show;
    with **--sort**=*time*, sort by WORD (newest first)

[**-t**](https://www.mankier.com/1/ls#-t)

:   sort by time, newest first; see **--time**

[**-T, --tabsize=COLS**](https://www.mankier.com/1/ls#-T)

:   assume tab stops at each COLS instead of 8

[**-u**](https://www.mankier.com/1/ls#-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

[**-U**](https://www.mankier.com/1/ls#-U)

:   do not sort directory entries

[**--version**](https://www.mankier.com/1/ls#--version)

:   output version information and exit

[**-v**](https://www.mankier.com/1/ls#-v)

:   natural sort of (version) numbers within text

[**-w, --width=COLS**](https://www.mankier.com/1/ls#-w)

:   set output width to COLS.  0 means no limit

[**-x**](https://www.mankier.com/1/ls#-x)

:   list entries by lines instead of by columns

[**-X**](https://www.mankier.com/1/ls#-X)

:   sort alphabetically by entry extension

[**-Z, --context**](https://www.mankier.com/1/ls#-Z)

:   print any security context of each file

[**--zero**](https://www.mankier.com/1/ls#--zero)

:   end each output line with NUL, not newline
