OILS / benchmarks / parse-help / ls.txt View on Github | oilshell.org

116 lines, 111 significant
1Usage: ls [OPTION]... [FILE]...
2List information about the FILEs (the current directory by default).
3Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
4
5Mandatory arguments to long options are mandatory for short options too.
6 -a, --all do not ignore entries starting with .
7 -A, --almost-all do not list implied . and ..
8 --author with -l, print the author of each file
9 -b, --escape print C-style escapes for nongraphic characters
10 --block-size=SIZE scale sizes by SIZE before printing them; e.g.,
11 '--block-size=M' prints sizes in units of
12 1,048,576 bytes; see SIZE format below
13 -B, --ignore-backups do not list implied entries ending with ~
14 -c with -lt: sort by, and show, ctime (time of last
15 modification of file status information);
16 with -l: show ctime and sort by name;
17 otherwise: sort by ctime, newest first
18 -C list entries by columns
19 --color[=WHEN] colorize the output; WHEN can be 'always' (default
20 if omitted), 'auto', or 'never'; more info below
21 -d, --directory list directories themselves, not their contents
22 -D, --dired generate output designed for Emacs' dired mode
23 -f do not sort, enable -aU, disable -ls --color
24 -F, --classify append indicator (one of */=>@|) to entries
25 --file-type likewise, except do not append '*'
26 --format=WORD across -x, commas -m, horizontal -x, long -l,
27 single-column -1, verbose -l, vertical -C
28 --full-time like -l --time-style=full-iso
29 -g like -l, but do not list owner
30 --group-directories-first
31 group directories before files;
32 can be augmented with a --sort option, but any
33 use of --sort=none (-U) disables grouping
34 -G, --no-group in a long listing, don't print group names
35 -h, --human-readable with -l and/or -s, print human readable sizes
36 (e.g., 1K 234M 2G)
37 --si likewise, but use powers of 1000 not 1024
38 -H, --dereference-command-line
39 follow symbolic links listed on the command line
40 --dereference-command-line-symlink-to-dir
41 follow each command line symbolic link
42 that points to a directory
43 --hide=PATTERN do not list implied entries matching shell PATTERN
44 (overridden by -a or -A)
45 --indicator-style=WORD append indicator with style WORD to entry names:
46 none (default), slash (-p),
47 file-type (--file-type), classify (-F)
48 -i, --inode print the index number of each file
49 -I, --ignore=PATTERN do not list implied entries matching shell PATTERN
50 -k, --kibibytes default to 1024-byte blocks for disk usage
51 -l use a long listing format
52 -L, --dereference when showing file information for a symbolic
53 link, show information for the file the link
54 references rather than for the link itself
55 -m fill width with a comma separated list of entries
56 -n, --numeric-uid-gid like -l, but list numeric user and group IDs
57 -N, --literal print raw entry names (don't treat e.g. control
58 characters specially)
59 -o like -l, but do not list group information
60 -p, --indicator-style=slash
61 append / indicator to directories
62 -q, --hide-control-chars print ? instead of nongraphic characters
63 --show-control-chars show nongraphic characters as-is (the default,
64 unless program is 'ls' and output is a terminal)
65 -Q, --quote-name enclose entry names in double quotes
66 --quoting-style=WORD use quoting style WORD for entry names:
67 literal, locale, shell, shell-always,
68 shell-escape, shell-escape-always, c, escape
69 -r, --reverse reverse order while sorting
70 -R, --recursive list subdirectories recursively
71 -s, --size print the allocated size of each file, in blocks
72 -S sort by file size, largest first
73 --sort=WORD sort by WORD instead of name: none (-U), size (-S),
74 time (-t), version (-v), extension (-X)
75 --time=WORD with -l, show time as WORD instead of default
76 modification time: atime or access or use (-u);
77 ctime or status (-c); also use specified time
78 as sort key if --sort=time (newest first)
79 --time-style=STYLE with -l, show times using style STYLE:
80 full-iso, long-iso, iso, locale, or +FORMAT;
81 FORMAT is interpreted like in 'date'; if FORMAT
82 is FORMAT1<newline>FORMAT2, then FORMAT1 applies
83 to non-recent files and FORMAT2 to recent files;
84 if STYLE is prefixed with 'posix-', STYLE
85 takes effect only outside the POSIX locale
86 -t sort by modification time, newest first
87 -T, --tabsize=COLS assume tab stops at each COLS instead of 8
88 -u with -lt: sort by, and show, access time;
89 with -l: show access time and sort by name;
90 otherwise: sort by access time, newest first
91 -U do not sort; list entries in directory order
92 -v natural sort of (version) numbers within text
93 -w, --width=COLS set output width to COLS. 0 means no limit
94 -x list entries by lines instead of by columns
95 -X sort alphabetically by entry extension
96 -Z, --context print any security context of each file
97 -1 list one file per line. Avoid '\n' with -q or -b
98 --help display this help and exit
99 --version output version information and exit
100
101The SIZE argument is an integer and optional unit (example: 10K is 10*1024).
102Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).
103
104Using color to distinguish file types is disabled both by default and
105with --color=never. With --color=auto, ls emits color codes only when
106standard output is connected to a terminal. The LS_COLORS environment
107variable can change the settings. Use the dircolors command to set it.
108
109Exit status:
110 0 if OK,
111 1 if minor problems (e.g., cannot access subdirectory),
112 2 if serious trouble (e.g., cannot access command-line argument).
113
114GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
115Full documentation at: <http://www.gnu.org/software/coreutils/ls>
116or available locally via: info '(coreutils) ls invocation'