LS(1) User Commands LS(1)
NNAAMMEE
ls - list directory contents
SSYYNNOOPPSSIISS
llss [_O_P_T_I_O_N]... [_F_I_L_E]...
DDEESSCCRRIIPPTTIIOONN
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of --ccffttuuvvSSUUXX nor ----ssoorrtt is speci‐
fied.
Mandatory arguments to long options are mandatory for short options
too.
--aa, ----aallll
do not ignore entries starting with .
--AA, ----aallmmoosstt--aallll
do not list implied . and ..
----aauutthhoorr
with --ll, print the author of each file
--bb, ----eessccaappee
print C-style escapes for nongraphic characters
----bblloocckk--ssiizzee=_S_I_Z_E
scale sizes by SIZE before printing them; e.g., '--block-size=M'
prints sizes in units of 1,048,576 bytes; see SIZE format below
--BB, ----iiggnnoorree--bbaacckkuuppss
do not list implied entries ending with ~
--cc with --lltt: sort by, and show, ctime (time of last modification of
file status information); with --ll: show ctime and sort by name;
otherwise: sort by ctime, newest first
--CC list entries by columns
----ccoolloorr[=_W_H_E_N]
colorize the output; WHEN can be 'never', 'auto', or 'always'
(the default); more info below
--dd, ----ddiirreeccttoorryy
list directories themselves, not their contents
--DD, ----ddiirreedd
generate output designed for Emacs' dired mode
--ff do not sort, enable --aaUU, disable --llss ----ccoolloorr
--FF, ----ccllaassssiiffyy
append indicator (one of */=>@|) to entries
----ffiillee--ttyyppee
likewise, except do not append '*'
----ffoorrmmaatt=_W_O_R_D
across --xx, commas --mm, horizontal --xx, long --ll, single-column --11,
verbose --ll, vertical --CC
----ffuullll--ttiimmee
like --ll ----ttiimmee--ssttyyllee=_f_u_l_l_-_i_s_o
--gg like --ll, but do not list owner
----ggrroouupp--ddiirreeccttoorriieess--ffiirrsstt
group directories before files;
can be augmented with a ----ssoorrtt option, but any use of
----ssoorrtt=_n_o_n_e (--UU) disables grouping
--GG, ----nnoo--ggrroouupp
in a long listing, don't print group names
--hh, ----hhuummaann--rreeaaddaabbllee
with --ll, print sizes in human readable format (e.g., 1K 234M 2G)
----ssii likewise, but use powers of 1000 not 1024
--HH, ----ddeerreeffeerreennccee--ccoommmmaanndd--lliinnee
follow symbolic links listed on the command line
----ddeerreeffeerreennccee--ccoommmmaanndd--lliinnee--ssyymmlliinnkk--ttoo--ddiirr
follow each command line symbolic link
that points to a directory
----hhiiddee=_P_A_T_T_E_R_N
do not list implied entries matching shell PATTERN (overridden
by --aa or --AA)
----iinnddiiccaattoorr--ssttyyllee=_W_O_R_D
append indicator with style WORD to entry names: none (default),
slash (--pp), file-type (----ffiillee--ttyyppee), classify (--FF)
--ii, ----iinnooddee
print the index number of each file
--II, ----iiggnnoorree=_P_A_T_T_E_R_N
do not list implied entries matching shell PATTERN
--kk, ----kkiibbiibbyytteess
default to 1024-byte blocks for disk usage
--ll use a long listing format
--LL, ----ddeerreeffeerreennccee
when showing file information for a symbolic link, show informa‐
tion for the file the link references rather than for the link
itself
--mm fill width with a comma separated list of entries
--nn, ----nnuummeerriicc--uuiidd--ggiidd
like --ll, but list numeric user and group IDs
--NN, ----lliitteerraall
print raw entry names (don't treat e.g. control characters spe‐
cially)
--oo like --ll, but do not list group information
--pp, ----iinnddiiccaattoorr--ssttyyllee=_s_l_a_s_h
append / indicator to directories
--qq, ----hhiiddee--ccoonnttrrooll--cchhaarrss
print ? instead of nongraphic characters
----sshhooww--ccoonnttrrooll--cchhaarrss
show nongraphic characters as-is (the default, unless program is
'ls' and output is a terminal)
--QQ, ----qquuoottee--nnaammee
enclose entry names in double quotes
----qquuoottiinngg--ssttyyllee=_W_O_R_D
use quoting style WORD for entry names: literal, locale, shell,
shell-always, c, escape
--rr, ----rreevveerrssee
reverse order while sorting
--RR, ----rreeccuurrssiivvee
list subdirectories recursively
--ss, ----ssiizzee
print the allocated size of each file, in blocks
--SS sort by file size
----ssoorrtt=_W_O_R_D
sort by WORD instead of name: none (--UU), size (--SS), time (--tt),
version (--vv), extension (--XX)
----ttiimmee=_W_O_R_D
with --ll, show time as WORD instead of default modification time:
atime or access or use (--uu) ctime or status (--cc); also use spec‐
ified time as sort key if ----ssoorrtt=_t_i_m_e
----ttiimmee--ssttyyllee=_S_T_Y_L_E
with --ll, show times using style STYLE: full-iso, long-iso, iso,
locale, or +FORMAT; FORMAT is interpreted like in 'date'; if
FORMAT is FORMAT1<newline>FORMAT2, then FORMAT1 applies to
non-recent files and FORMAT2 to recent files; if STYLE is pre‐
fixed with 'posix-', STYLE takes effect only outside the POSIX
locale
--tt sort by modification time, newest first
--TT, ----ttaabbssiizzee=_C_O_L_S
assume tab stops at each COLS instead of 8
--uu with --lltt: sort by, and show, access time; with --ll: show access
time and sort by name; otherwise: sort by access time
--UU do not sort; list entries in directory order
--vv natural sort of (version) numbers within text
--ww, ----wwiiddtthh=_C_O_L_S
assume screen width instead of current value
--xx list entries by lines instead of by columns
--XX sort alphabetically by entry extension
--11 list one file per line
SELinux options:
----llccoonntteexxtt
Display security context. Enable --ll. Lines will probably be
too wide for most displays.
--ZZ, ----ccoonntteexxtt
Display security context so it fits on most displays. Displays
only mode, user, group, security context and file name.
----ssccoonntteexxtt
Display only security context and file name.
----hheellpp display this help and exit
----vveerrssiioonn
output version information and exit
SIZE is an integer and optional unit (example: 10M is 10*1024*1024).
Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (pow‐
ers of 1000).
Using color to distinguish file types is disabled both by default and
with ----ccoolloorr=_n_e_v_e_r. With ----ccoolloorr=_a_u_t_o, ls emits color codes only when
standard output is connected to a terminal. The LS_COLORS environment
variable can change the settings. Use the dircolors command to set it.
EExxiitt ssttaattuuss::
0 if OK,
1 if minor problems (e.g., cannot access subdirectory),
2 if serious trouble (e.g., cannot access command-line argument).
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report ls translation bugs to <http://translationproject.org/team/>
AAUUTTHHOORR
Written by Richard M. Stallman and David MacKenzie.
CCOOPPYYRRIIGGHHTT
Copyright © 2013 Free Software Foundation, Inc. License GPLv3+: GNU
GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
SSEEEE AALLSSOO
The full documentation for llss is maintained as a Texinfo manual. If
the iinnffoo and llss programs are properly installed at your site, the com‐
mand
iinnffoo ccoorreeuuttiillss ''llss iinnvvooccaattiioonn''
should give you access to the complete manual.
GNU coreutils 8.22 April 2018 LS(1)