|
| 1 | +LS(1) User Commands LS(1) |
| 2 | + |
| 3 | +NNAAMMEE |
| 4 | + ls - list directory contents |
| 5 | + |
| 6 | +SSYYNNOOPPSSIISS |
| 7 | + llss [_O_P_T_I_O_N]... [_F_I_L_E]... |
| 8 | + |
| 9 | +DDEESSCCRRIIPPTTIIOONN |
| 10 | + List information about the FILEs (the current directory by default). Sort entries alphabetically |
| 11 | + if none of --ccffttuuvvSSUUXX nor ----ssoorrtt is specified. |
| 12 | + |
| 13 | + Mandatory arguments to long options are mandatory for short options too. |
| 14 | + |
| 15 | + --aa, ----aallll |
| 16 | + do not ignore entries starting with . |
| 17 | + |
| 18 | + --AA, ----aallmmoosstt--aallll |
| 19 | + do not list implied . and .. |
| 20 | + |
| 21 | + ----aauutthhoorr |
| 22 | + with --ll, print the author of each file |
| 23 | + |
| 24 | + --bb, ----eessccaappee |
| 25 | + print C-style escapes for nongraphic characters |
| 26 | + |
| 27 | + ----bblloocckk--ssiizzee=_S_I_Z_E |
| 28 | + scale sizes by SIZE before printing them; e.g., '--block-size=M' prints sizes in units of |
| 29 | + 1,048,576 bytes; see SIZE format below |
| 30 | + |
| 31 | + --BB, ----iiggnnoorree--bbaacckkuuppss |
| 32 | + do not list implied entries ending with ~ |
| 33 | + |
| 34 | + --cc with --lltt: sort by, and show, ctime (time of last modification of file status information); |
| 35 | + with --ll: show ctime and sort by name; otherwise: sort by ctime, newest first |
| 36 | + |
| 37 | + --CC list entries by columns |
| 38 | + |
| 39 | + ----ccoolloorr[=_W_H_E_N] |
| 40 | + colorize the output; WHEN can be 'always' (default if omitted), 'auto', or 'never'; more |
| 41 | + info below |
| 42 | + |
| 43 | + --dd, ----ddiirreeccttoorryy |
| 44 | + list directories themselves, not their contents |
| 45 | + |
| 46 | + --DD, ----ddiirreedd |
| 47 | + generate output designed for Emacs' dired mode |
| 48 | + |
| 49 | + --ff do not sort, enable --aaUU, disable --llss ----ccoolloorr |
| 50 | + |
| 51 | + --FF, ----ccllaassssiiffyy |
| 52 | + append indicator (one of */=>@|) to entries |
| 53 | + |
| 54 | + ----ffiillee--ttyyppee |
| 55 | + likewise, except do not append '*' |
| 56 | + |
| 57 | + ----ffoorrmmaatt=_W_O_R_D |
| 58 | + across --xx, commas --mm, horizontal --xx, long --ll, single-column --11, verbose --ll, vertical --CC |
| 59 | + |
| 60 | + ----ffuullll--ttiimmee |
| 61 | + like --ll ----ttiimmee--ssttyyllee=_f_u_l_l_-_i_s_o |
| 62 | + |
| 63 | + --gg like --ll, but do not list owner |
| 64 | + |
| 65 | + ----ggrroouupp--ddiirreeccttoorriieess--ffiirrsstt |
| 66 | + group directories before files; |
| 67 | + |
| 68 | + can be augmented with a ----ssoorrtt option, but any use of ----ssoorrtt=_n_o_n_e (--UU) disables grouping |
| 69 | + |
| 70 | + --GG, ----nnoo--ggrroouupp |
| 71 | + in a long listing, don't print group names |
| 72 | + |
| 73 | + --hh, ----hhuummaann--rreeaaddaabbllee |
| 74 | + with --ll and/or --ss, print human readable sizes (e.g., 1K 234M 2G) |
| 75 | + |
| 76 | + ----ssii likewise, but use powers of 1000 not 1024 |
| 77 | + |
| 78 | + --HH, ----ddeerreeffeerreennccee--ccoommmmaanndd--lliinnee |
| 79 | + follow symbolic links listed on the command line |
| 80 | + |
| 81 | + ----ddeerreeffeerreennccee--ccoommmmaanndd--lliinnee--ssyymmlliinnkk--ttoo--ddiirr |
| 82 | + follow each command line symbolic link |
| 83 | + |
| 84 | + that points to a directory |
| 85 | + |
| 86 | + ----hhiiddee=_P_A_T_T_E_R_N |
| 87 | + do not list implied entries matching shell PATTERN (overridden by --aa or --AA) |
| 88 | + |
| 89 | + ----hhyyppeerrlliinnkk[=_W_H_E_N] |
| 90 | + hyperlink file names; WHEN can be 'always' (default if omitted), 'auto', or 'never' |
| 91 | + |
| 92 | + ----iinnddiiccaattoorr--ssttyyllee=_W_O_R_D |
| 93 | + append indicator with style WORD to entry names: none (default), slash (--pp), file-type |
| 94 | + (----ffiillee--ttyyppee), classify (--FF) |
| 95 | + |
| 96 | + --ii, ----iinnooddee |
| 97 | + print the index number of each file |
| 98 | + |
| 99 | + --II, ----iiggnnoorree=_P_A_T_T_E_R_N |
| 100 | + do not list implied entries matching shell PATTERN |
| 101 | + |
| 102 | + --kk, ----kkiibbiibbyytteess |
| 103 | + default to 1024-byte blocks for disk usage |
| 104 | + |
| 105 | + --ll use a long listing format |
| 106 | + |
| 107 | + --LL, ----ddeerreeffeerreennccee |
| 108 | + when showing file information for a symbolic link, show information for the file the link |
| 109 | + references rather than for the link itself |
| 110 | + |
| 111 | + --mm fill width with a comma separated list of entries |
| 112 | + |
| 113 | + --nn, ----nnuummeerriicc--uuiidd--ggiidd |
| 114 | + like --ll, but list numeric user and group IDs |
| 115 | + |
| 116 | + --NN, ----lliitteerraall |
| 117 | + print entry names without quoting |
| 118 | + |
| 119 | + --oo like --ll, but do not list group information |
| 120 | + |
| 121 | + --pp, ----iinnddiiccaattoorr--ssttyyllee=_s_l_a_s_h |
| 122 | + append / indicator to directories |
| 123 | + |
| 124 | + --qq, ----hhiiddee--ccoonnttrrooll--cchhaarrss |
| 125 | + print ? instead of nongraphic characters |
| 126 | + |
| 127 | + ----sshhooww--ccoonnttrrooll--cchhaarrss |
| 128 | + show nongraphic characters as-is (the default, unless program is 'ls' and output is a ter‐ |
| 129 | + minal) |
| 130 | + |
| 131 | + --QQ, ----qquuoottee--nnaammee |
| 132 | + enclose entry names in double quotes |
| 133 | + |
| 134 | + ----qquuoottiinngg--ssttyyllee=_W_O_R_D |
| 135 | + use quoting style WORD for entry names: literal, locale, shell, shell-always, shell-escape, |
| 136 | + shell-escape-always, c, escape |
| 137 | + |
| 138 | + --rr, ----rreevveerrssee |
| 139 | + reverse order while sorting |
| 140 | + |
| 141 | + --RR, ----rreeccuurrssiivvee |
| 142 | + list subdirectories recursively |
| 143 | + |
| 144 | + --ss, ----ssiizzee |
| 145 | + print the allocated size of each file, in blocks |
| 146 | + |
| 147 | + --SS sort by file size, largest first |
| 148 | + |
| 149 | + ----ssoorrtt=_W_O_R_D |
| 150 | + sort by WORD instead of name: none (--UU), size (--SS), time (--tt), version (--vv), extension (--XX) |
| 151 | + |
| 152 | + ----ttiimmee=_W_O_R_D |
| 153 | + with --ll, show time as WORD instead of default modification time: atime or access or use |
| 154 | + (--uu); ctime or status (--cc); also use specified time as sort key if ----ssoorrtt=_t_i_m_e (newest |
| 155 | + first) |
| 156 | + |
| 157 | + ----ttiimmee--ssttyyllee=_S_T_Y_L_E |
| 158 | + with --ll, show times using style STYLE: full-iso, long-iso, iso, locale, or +FORMAT; FORMAT |
| 159 | + is interpreted like in 'date'; if FORMAT is FORMAT1<newline>FORMAT2, then FORMAT1 applies |
| 160 | + to non-recent files and FORMAT2 to recent files; if STYLE is prefixed with 'posix-', STYLE |
| 161 | + takes effect only outside the POSIX locale |
| 162 | + |
| 163 | + --tt sort by modification time, newest first |
| 164 | + |
| 165 | + --TT, ----ttaabbssiizzee=_C_O_L_S |
| 166 | + assume tab stops at each COLS instead of 8 |
| 167 | + |
| 168 | + --uu with --lltt: sort by, and show, access time; with --ll: show access time and sort by name; oth‐ |
| 169 | + erwise: sort by access time, newest first |
| 170 | + |
| 171 | + --UU do not sort; list entries in directory order |
| 172 | + |
| 173 | + --vv natural sort of (version) numbers within text |
| 174 | + |
| 175 | + --ww, ----wwiiddtthh=_C_O_L_S |
| 176 | + set output width to COLS. 0 means no limit |
| 177 | + |
| 178 | + --xx list entries by lines instead of by columns |
| 179 | + |
| 180 | + --XX sort alphabetically by entry extension |
| 181 | + |
| 182 | + --ZZ, ----ccoonntteexxtt |
| 183 | + print any security context of each file |
| 184 | + |
| 185 | + --11 list one file per line. Avoid '\n' with --qq or --bb |
| 186 | + |
| 187 | + ----hheellpp display this help and exit |
| 188 | + |
| 189 | + ----vveerrssiioonn |
| 190 | + output version information and exit |
| 191 | + |
| 192 | + The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are |
| 193 | + K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000). |
| 194 | + |
| 195 | + Using color to distinguish file types is disabled both by default and with ----ccoolloorr=_n_e_v_e_r. With |
| 196 | + ----ccoolloorr=_a_u_t_o, ls emits color codes only when standard output is connected to a terminal. The |
| 197 | + LS_COLORS environment variable can change the settings. Use the dircolors command to set it. |
| 198 | + |
| 199 | + EExxiitt ssttaattuuss:: |
| 200 | + 0 if OK, |
| 201 | + |
| 202 | + 1 if minor problems (e.g., cannot access subdirectory), |
| 203 | + |
| 204 | + 2 if serious trouble (e.g., cannot access command-line argument). |
| 205 | + |
| 206 | +AAUUTTHHOORR |
| 207 | + Written by Richard M. Stallman and David MacKenzie. |
| 208 | + |
| 209 | +RREEPPOORRTTIINNGG BBUUGGSS |
| 210 | + GNU coreutils online help: <http://www.gnu.org/software/coreutils/> |
| 211 | + Report ls translation bugs to <http://translationproject.org/team/> |
| 212 | + |
| 213 | +CCOOPPYYRRIIGGHHTT |
| 214 | + Copyright © 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later |
| 215 | + <http://gnu.org/licenses/gpl.html>. |
| 216 | + This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the |
| 217 | + extent permitted by law. |
| 218 | + |
| 219 | +SSEEEE AALLSSOO |
| 220 | + Full documentation at: <http://www.gnu.org/software/coreutils/ls> |
| 221 | + or available locally via: info '(coreutils) ls invocation' |
| 222 | + |
| 223 | +GNU coreutils 8.28 January 2018 LS(1) |
0 commit comments