1DIR(1) User Commands DIR(1)
2
3
4
6 dir - list directory contents
7
9 dir [OPTION]... [FILE]...
10
12 List information about the FILEs (the current directory by default).
13 Sort entries alphabetically if none of -cftuvSUX nor --sort.
14
15 Mandatory arguments to long options are mandatory for short options
16 too.
17
18 -a, --all
19 do not ignore entries starting with .
20
21 -A, --almost-all
22 do not list implied . and ..
23
24 --author
25 with -l, print the author of each file
26
27 -b, --escape
28 print octal escapes for nongraphic characters
29
30 --block-size=SIZE
31 use SIZE-byte blocks
32
33 -B, --ignore-backups
34 do not list implied entries ending with ~
35
36 -c with -lt: sort by, and show, ctime (time of last modification of
37 file status information) with -l: show ctime and sort by name
38 otherwise: sort by ctime
39
40 -C list entries by columns
41
42 --color[=WHEN]
43 control whether color is used to distinguish file types. WHEN
44 may be `never', `always', or `auto'
45
46 -d, --directory
47 list directory entries instead of contents, and do not derefer‐
48 ence symbolic links
49
50 -D, --dired
51 generate output designed for Emacs' dired mode
52
53 -f do not sort, enable -aU, disable -ls --color
54
55 -F, --classify
56 append indicator (one of */=>@|) to entries
57
58 --file-type
59 likewise, except do not append `*'
60
61 --format=WORD
62 across -x, commas -m, horizontal -x, long -l, single-column -1,
63 verbose -l, vertical -C
64
65 --full-time
66 like -l --time-style=full-iso
67
68 -g like -l, but do not list owner
69
70 --group-directories-first
71 group directories before files
72
73 -G, --no-group
74 in a long listing, don't print group names
75
76 -h, --human-readable
77 with -l, print sizes in human readable format (e.g., 1K 234M 2G)
78
79 --si likewise, but use powers of 1000 not 1024
80
81 -H, --dereference-command-line
82 follow symbolic links listed on the command line
83
84 --dereference-command-line-symlink-to-dir
85 follow each command line symbolic link that points to a direc‐
86 tory
87
88 --hide=PATTERN
89 do not list implied entries matching shell PATTERN (overridden
90 by -a or -A)
91
92 --indicator-style=WORD
93 append indicator with style WORD to entry names: none (default),
94 slash (-p), file-type (--file-type), classify (-F)
95
96 -i, --inode
97 print the index number of each file
98
99 -I, --ignore=PATTERN
100 do not list implied entries matching shell PATTERN
101
102 -k like --block-size=1K
103
104 -l use a long listing format
105
106 -L, --dereference
107 when showing file information for a symbolic link, show informa‐
108 tion for the file the link references rather than for the link
109 itself
110
111 -m fill width with a comma separated list of entries
112
113 -n, --numeric-uid-gid
114 like -l, but list numeric user and group IDs
115
116 -N, --literal
117 print raw entry names (don't treat e.g. control characters spe‐
118 cially)
119
120 -o like -l, but do not list group information
121
122 -p, --indicator-style=slash
123 append / indicator to directories
124
125 -q, --hide-control-chars
126 print ? instead of non graphic characters
127
128 --show-control-chars
129 show non graphic characters as-is (default unless program is
130 `ls' and output is a terminal)
131
132 -Q, --quote-name
133 enclose entry names in double quotes
134
135 --quoting-style=WORD
136 use quoting style WORD for entry names: literal, locale, shell,
137 shell-always, c, escape
138
139 -r, --reverse
140 reverse order while sorting
141
142 -R, --recursive
143 list subdirectories recursively
144
145 -s, --size
146 print the size of each file, in blocks
147
148 -S sort by file size
149
150 --sort=WORD
151 sort by WORD instead of name: none -U, extension -X, size -S,
152 time -t, version -v
153
154 --time=WORD
155 with -l, show time as WORD instead of modification time: atime
156 -u, access -u, use -u, ctime -c, or status -c; use specified
157 time as sort key if --sort=time
158
159 --time-style=STYLE
160 with -l, show times using style STYLE: full-iso, long-iso, iso,
161 locale, +FORMAT. FORMAT is interpreted like `date'; if FORMAT
162 is FORMAT1<newline>FORMAT2, FORMAT1 applies to non-recent files
163 and FORMAT2 to recent files; if STYLE is prefixed with `posix-',
164 STYLE takes effect only outside the POSIX locale
165
166 -t sort by modification time
167
168 -T, --tabsize=COLS
169 assume tab stops at each COLS instead of 8
170
171 -u with -lt: sort by, and show, access time with -l: show access
172 time and sort by name otherwise: sort by access time
173
174 -U do not sort; list entries in directory order
175
176 -v sort by version
177
178 -w, --width=COLS
179 assume screen width instead of current value
180
181 -x list entries by lines instead of by columns
182
183 -X sort alphabetically by entry extension
184
185 -1 list one file per line
186
187 SELINUX options:
188
189 --lcontext
190 Display security context. Enable -l. Lines will probably be
191 too wide for most displays.
192
193 --context
194 Display security context so it fits on most displays. Displays
195 only mode, user, group, security context and file name.
196
197 --scontext
198 Display only security context and file name.
199
200 --help display this help and exit
201
202 --version
203 output version information and exit
204
205 SIZE may be (or may be an integer optionally followed by) one of fol‐
206 lowing: kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T,
207 P, E, Z, Y.
208
209 By default, color is not used to distinguish types of files. That is
210 equivalent to using --color=none. Using the --color option without the
211 optional WHEN argument is equivalent to using --color=always. With
212 --color=auto, color codes are output only if standard output is con‐
213 nected to a terminal (tty). The environment variable LS_COLORS can
214 influence the colors, and can be set easily by the dircolors command.
215
216 Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble.
217
219 Written by Richard Stallman and David MacKenzie.
220
222 Report bugs to <bug-coreutils@gnu.org>.
223
225 Copyright © 2007 Free Software Foundation, Inc.
226 This is free software. You may redistribute copies of it under the
227 terms of the GNU General Public License
228 <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the
229 extent permitted by law.
230
232 The full documentation for dir is maintained as a Texinfo manual. If
233 the info and dir programs are properly installed at your site, the com‐
234 mand
235
236 info dir
237
238 should give you access to the complete manual.
239
240
241
242GNU coreutils 6.9 March 2007 DIR(1)