| 1 |
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.50.1. |
| 2 |
.TH DIR "1" "June 2025" "GNU coreutils 9.7" "User Commands" |
| 3 |
.SH NAME |
| 4 |
dir \- list directory contents |
| 5 |
.SH SYNOPSIS |
| 6 |
.B dir |
| 7 |
[\fI\,OPTION\/\fR]... [\fI\,FILE\/\fR]... |
| 8 |
.SH DESCRIPTION |
| 9 |
.\" Add any additional description here |
| 10 |
.PP |
| 11 |
List information about the FILEs (the current directory by default). |
| 12 |
Sort entries alphabetically if none of \fB\-cftuvSUX\fR nor \fB\-\-sort\fR is specified. |
| 13 |
.PP |
| 14 |
Mandatory arguments to long options are mandatory for short options too. |
| 15 |
.TP |
| 16 |
\fB\-a\fR, \fB\-\-all\fR |
| 17 |
do not ignore entries starting with . |
| 18 |
.TP |
| 19 |
\fB\-A\fR, \fB\-\-almost\-all\fR |
| 20 |
do not list implied . and .. |
| 21 |
.TP |
| 22 |
\fB\-\-author\fR |
| 23 |
with \fB\-l\fR, print the author of each file |
| 24 |
.TP |
| 25 |
\fB\-b\fR, \fB\-\-escape\fR |
| 26 |
print C\-style escapes for nongraphic characters |
| 27 |
.TP |
| 28 |
\fB\-\-block\-size\fR=\fI\,SIZE\/\fR |
| 29 |
with \fB\-l\fR, scale sizes by SIZE when printing them; |
| 30 |
e.g., '\-\-block\-size=M'; see SIZE format below |
| 31 |
.TP |
| 32 |
\fB\-B\fR, \fB\-\-ignore\-backups\fR |
| 33 |
do not list implied entries ending with ~ |
| 34 |
.TP |
| 35 |
\fB\-c\fR |
| 36 |
with \fB\-lt\fR: sort by, and show, ctime (time of last |
| 37 |
change of file status information); |
| 38 |
with \fB\-l\fR: show ctime and sort by name; |
| 39 |
otherwise: sort by ctime, newest first |
| 40 |
.TP |
| 41 |
\fB\-C\fR |
| 42 |
list entries by columns |
| 43 |
.TP |
| 44 |
\fB\-\-color\fR[=\fI\,WHEN\/\fR] |
| 45 |
color the output WHEN; more info below |
| 46 |
.TP |
| 47 |
\fB\-d\fR, \fB\-\-directory\fR |
| 48 |
list directories themselves, not their contents |
| 49 |
.TP |
| 50 |
\fB\-D\fR, \fB\-\-dired\fR |
| 51 |
generate output designed for Emacs' dired mode |
| 52 |
.TP |
| 53 |
\fB\-f\fR |
| 54 |
same as \fB\-a\fR \fB\-U\fR |
| 55 |
.TP |
| 56 |
\fB\-F\fR, \fB\-\-classify\fR[=\fI\,WHEN\/\fR] |
| 57 |
append indicator (one of */=>@|) to entries WHEN |
| 58 |
.TP |
| 59 |
\fB\-\-file\-type\fR |
| 60 |
likewise, except do not append '*' |
| 61 |
.TP |
| 62 |
\fB\-\-format\fR=\fI\,WORD\/\fR |
| 63 |
across,horizontal (\fB\-x\fR), commas (\fB\-m\fR), long (\fB\-l\fR), |
| 64 |
single\-column (\fB\-1\fR), verbose (\fB\-l\fR), vertical (\fB\-C\fR) |
| 65 |
.TP |
| 66 |
\fB\-\-full\-time\fR |
| 67 |
like \fB\-l\fR \fB\-\-time\-style\fR=\fI\,full\-iso\/\fR |
| 68 |
.TP |
| 69 |
\fB\-g\fR |
| 70 |
like \fB\-l\fR, but do not list owner |
| 71 |
.TP |
| 72 |
\fB\-\-group\-directories\-first\fR |
| 73 |
group directories before files |
| 74 |
.TP |
| 75 |
\fB\-G\fR, \fB\-\-no\-group\fR |
| 76 |
in a long listing, don't print group names |
| 77 |
.TP |
| 78 |
\fB\-h\fR, \fB\-\-human\-readable\fR |
| 79 |
with \fB\-l\fR and \fB\-s\fR, print sizes like 1K 234M 2G etc. |
| 80 |
.TP |
| 81 |
\fB\-\-si\fR |
| 82 |
likewise, but use powers of 1000 not 1024 |
| 83 |
.TP |
| 84 |
\fB\-H\fR, \fB\-\-dereference\-command\-line\fR |
| 85 |
follow symbolic links listed on the command line |
| 86 |
.TP |
| 87 |
\fB\-\-dereference\-command\-line\-symlink\-to\-dir\fR |
| 88 |
follow each command line symbolic link |
| 89 |
that points to a directory |
| 90 |
.TP |
| 91 |
\fB\-\-hide\fR=\fI\,PATTERN\/\fR |
| 92 |
do not list implied entries matching shell PATTERN |
| 93 |
(overridden by \fB\-a\fR or \fB\-A\fR) |
| 94 |
.TP |
| 95 |
\fB\-\-hyperlink\fR[=\fI\,WHEN\/\fR] |
| 96 |
hyperlink file names WHEN |
| 97 |
.TP |
| 98 |
\fB\-\-indicator\-style\fR=\fI\,WORD\/\fR |
| 99 |
append indicator with style WORD to entry names: |
| 100 |
none (default), slash (\fB\-p\fR), |
| 101 |
file\-type (\fB\-\-file\-type\fR), classify (\fB\-F\fR) |
| 102 |
.TP |
| 103 |
\fB\-i\fR, \fB\-\-inode\fR |
| 104 |
print the index number of each file |
| 105 |
.TP |
| 106 |
\fB\-I\fR, \fB\-\-ignore\fR=\fI\,PATTERN\/\fR |
| 107 |
do not list implied entries matching shell PATTERN |
| 108 |
.TP |
| 109 |
\fB\-k\fR, \fB\-\-kibibytes\fR |
| 110 |
default to 1024\-byte blocks for file system usage; |
| 111 |
used only with \fB\-s\fR and per directory totals |
| 112 |
.TP |
| 113 |
\fB\-l\fR |
| 114 |
use a long listing format |
| 115 |
.TP |
| 116 |
\fB\-L\fR, \fB\-\-dereference\fR |
| 117 |
when showing file information for a symbolic |
| 118 |
link, show information for the file the link |
| 119 |
references rather than for the link itself |
| 120 |
.TP |
| 121 |
\fB\-m\fR |
| 122 |
fill width with a comma separated list of entries |
| 123 |
.TP |
| 124 |
\fB\-n\fR, \fB\-\-numeric\-uid\-gid\fR |
| 125 |
like \fB\-l\fR, but list numeric user and group IDs |
| 126 |
.TP |
| 127 |
\fB\-N\fR, \fB\-\-literal\fR |
| 128 |
print entry names without quoting |
| 129 |
.TP |
| 130 |
\fB\-o\fR |
| 131 |
like \fB\-l\fR, but do not list group information |
| 132 |
.TP |
| 133 |
\fB\-p\fR, \fB\-\-indicator\-style\fR=\fI\,slash\/\fR |
| 134 |
append / indicator to directories |
| 135 |
.TP |
| 136 |
\fB\-q\fR, \fB\-\-hide\-control\-chars\fR |
| 137 |
print ? instead of nongraphic characters |
| 138 |
.TP |
| 139 |
\fB\-\-show\-control\-chars\fR |
| 140 |
show nongraphic characters as\-is (the default, |
| 141 |
unless program is 'ls' and output is a terminal) |
| 142 |
.TP |
| 143 |
\fB\-Q\fR, \fB\-\-quote\-name\fR |
| 144 |
enclose entry names in double quotes |
| 145 |
.TP |
| 146 |
\fB\-\-quoting\-style\fR=\fI\,WORD\/\fR |
| 147 |
use quoting style WORD for entry names: |
| 148 |
literal, locale, shell, shell\-always, |
| 149 |
shell\-escape, shell\-escape\-always, c, escape |
| 150 |
(overrides QUOTING_STYLE environment variable) |
| 151 |
.TP |
| 152 |
\fB\-r\fR, \fB\-\-reverse\fR |
| 153 |
reverse order while sorting |
| 154 |
.TP |
| 155 |
\fB\-R\fR, \fB\-\-recursive\fR |
| 156 |
list subdirectories recursively |
| 157 |
.TP |
| 158 |
\fB\-s\fR, \fB\-\-size\fR |
| 159 |
print the allocated size of each file, in blocks |
| 160 |
.TP |
| 161 |
\fB\-S\fR |
| 162 |
sort by file size, largest first |
| 163 |
.TP |
| 164 |
\fB\-\-sort\fR=\fI\,WORD\/\fR |
| 165 |
change default 'name' sort to WORD: |
| 166 |
none (\fB\-U\fR), size (\fB\-S\fR), time (\fB\-t\fR), |
| 167 |
version (\fB\-v\fR), extension (\fB\-X\fR), name, width |
| 168 |
.TP |
| 169 |
\fB\-\-time\fR=\fI\,WORD\/\fR |
| 170 |
select which timestamp used to display or sort; |
| 171 |
access time (\fB\-u\fR): atime, access, use; |
| 172 |
metadata change time (\fB\-c\fR): ctime, status; |
| 173 |
modified time (default): mtime, modification; |
| 174 |
birth time: birth, creation; |
| 175 |
.IP |
| 176 |
with \fB\-l\fR, WORD determines which time to show; |
| 177 |
with \fB\-\-sort\fR=\fI\,time\/\fR, sort by WORD (newest first) |
| 178 |
.TP |
| 179 |
\fB\-\-time\-style\fR=\fI\,TIME_STYLE\/\fR |
| 180 |
time/date format with \fB\-l\fR; see TIME_STYLE below |
| 181 |
.TP |
| 182 |
\fB\-t\fR |
| 183 |
sort by time, newest first; see \fB\-\-time\fR |
| 184 |
.TP |
| 185 |
\fB\-T\fR, \fB\-\-tabsize\fR=\fI\,COLS\/\fR |
| 186 |
assume tab stops at each COLS instead of 8 |
| 187 |
.TP |
| 188 |
\fB\-u\fR |
| 189 |
with \fB\-lt\fR: sort by, and show, access time; |
| 190 |
with \fB\-l\fR: show access time and sort by name; |
| 191 |
otherwise: sort by access time, newest first |
| 192 |
.TP |
| 193 |
\fB\-U\fR |
| 194 |
do not sort directory entries |
| 195 |
.TP |
| 196 |
\fB\-v\fR |
| 197 |
natural sort of (version) numbers within text |
| 198 |
.TP |
| 199 |
\fB\-w\fR, \fB\-\-width\fR=\fI\,COLS\/\fR |
| 200 |
set output width to COLS. 0 means no limit |
| 201 |
.TP |
| 202 |
\fB\-x\fR |
| 203 |
list entries by lines instead of by columns |
| 204 |
.TP |
| 205 |
\fB\-X\fR |
| 206 |
sort alphabetically by entry extension |
| 207 |
.TP |
| 208 |
\fB\-Z\fR, \fB\-\-context\fR |
| 209 |
print any security context of each file |
| 210 |
.TP |
| 211 |
\fB\-\-zero\fR |
| 212 |
end each output line with NUL, not newline |
| 213 |
.TP |
| 214 |
\fB\-1\fR |
| 215 |
list one file per line |
| 216 |
.TP |
| 217 |
\fB\-\-help\fR |
| 218 |
display this help and exit |
| 219 |
.TP |
| 220 |
\fB\-\-version\fR |
| 221 |
output version information and exit |
| 222 |
.PP |
| 223 |
The SIZE argument is an integer and optional unit (example: 10K is 10*1024). |
| 224 |
Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or KB,MB,... (powers of 1000). |
| 225 |
Binary prefixes can be used, too: KiB=K, MiB=M, and so on. |
| 226 |
.PP |
| 227 |
The TIME_STYLE argument can be full\-iso, long\-iso, iso, locale, or +FORMAT. |
| 228 |
FORMAT is interpreted like in \fBdate\fP(1). If FORMAT is FORMAT1<newline>FORMAT2, |
| 229 |
then FORMAT1 applies to non\-recent files and FORMAT2 to recent files. |
| 230 |
TIME_STYLE prefixed with 'posix\-' takes effect only outside the POSIX locale. |
| 231 |
Also the TIME_STYLE environment variable sets the default style to use. |
| 232 |
.PP |
| 233 |
The WHEN argument defaults to 'always' and can also be 'auto' or 'never'. |
| 234 |
.PP |
| 235 |
Using color to distinguish file types is disabled both by default and |
| 236 |
with \fB\-\-color\fR=\fI\,never\/\fR. With \fB\-\-color\fR=\fI\,auto\/\fR, ls emits color codes only when |
| 237 |
standard output is connected to a terminal. The LS_COLORS environment |
| 238 |
variable can change the settings. Use the \fBdircolors\fP(1) command to set it. |
| 239 |
.SS "Exit status:" |
| 240 |
.TP |
| 241 |
0 |
| 242 |
if OK, |
| 243 |
.TP |
| 244 |
1 |
| 245 |
if minor problems (e.g., cannot access subdirectory), |
| 246 |
.TP |
| 247 |
2 |
| 248 |
if serious trouble (e.g., cannot access command\-line argument). |
| 249 |
.SH AUTHOR |
| 250 |
Written by Richard M. Stallman and David MacKenzie. |
| 251 |
.SH "REPORTING BUGS" |
| 252 |
GNU coreutils online help: <https://www.gnu.org/software/coreutils/> |
| 253 |
.br |
| 254 |
Report any translation bugs to <https://translationproject.org/team/> |
| 255 |
.SH "SEE ALSO" |
| 256 |
Full documentation <https://www.gnu.org/software/coreutils/dir> |
| 257 |
.br |
| 258 |
or available locally via: info \(aq(coreutils) dir invocation\(aq |
| 259 |
.PP |
| 260 |
.br |
| 261 |
Packaged by Debian (9.7\-3) |
| 262 |
.br |
| 263 |
Copyright \(co 2025 Free Software Foundation, Inc. |
| 264 |
.br |
| 265 |
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. |
| 266 |
.br |
| 267 |
This is free software: you are free to change and redistribute it. |
| 268 |
.br |
| 269 |
There is NO WARRANTY, to the extent permitted by law. |