1 .\" Copyright Andries Brouwer, Ragnar Hojland Espinosa and A. Wik, 1998.
3 .\" This file may be copied under the conditions described
4 .\" in the LDP GENERAL PUBLIC LICENSE, Version 1, September 1998
5 .\" that should have been distributed together with this file.
7 .TH DU 1 1998-11 "GNU fileutils 4.0"
9 du \- estimate file space usage
11 .BI "du [" options "] [" file... ]
16 GNU options (shortest form):
18 .BI "[\-\-block\-size=" size ]
19 .BI "[\-\-exclude=" pattern ]
20 .BI "[\-\-max\-depth=" n ]
21 .B "[\-\-help] [\-\-version] [\-\-]"
24 reports the amount of disk space used by the specified files,
25 and by each directory in the hierarchies rooted at the
27 Here `disk space used' means space used for the entire
28 file hierarchy below the specified file.
32 reports the disk space for the current directory.
34 The output is in 512-byte units by default, but in
35 1024-byte units when the \-k option is given.
37 The output is in 1024-byte units (when no units are
38 specified by options), unless the environment variable
40 is set, in which case POSIX is followed.
44 Show counts for all files encountered, not just directories.
47 Use 1024-byte units instead of the default 512-byte units.
50 Only output space usage for the actual arguments given,
51 not for their subdirectories.
54 Only count space on the same device as the argument given.
57 Terminate option list.
61 Show counts for all files, not just directories.
64 Print sizes in bytes, instead of kilobytes.
66 .BI "\-\-block\-size=" size
67 Print sizes in blocks of
70 (New in file\%utils-4.0.)
73 Print a grand total of all arguments after all arguments have been
74 processed. This can be used to find out the total disk usage of a
75 given set of files or directories.
77 .B "\-D, \-\-dereference\-args"
78 Dereference symbolic links that are command line arguments. Does
79 not affect other symbolic links. This is helpful for finding out
80 the disk usage of directories, such as
82 which are often symbolic links.
84 .BI "\-\-exclude=" pattern
85 When recursing, skip subdirectories or files matching
89 may be any standard Bourne shell file glob pattern.
90 (New in file\%utils-4.0.)
92 .B "\-h, \-\-human\-readable"
93 Append a size letter, such as
95 for binary megabytes (`mebibytes'), to each size.
100 but use the official SI units (with powers of 1000 instead of 1024,
101 so that M stands for 1000000 instead of 1048576).
102 (New in file\%utils-4.0.)
104 .B "\-k, \-\-kilobytes"
105 Print sizes in KiB (binary kilobytes, 1024 bytes).
107 .B "\-l, \-\-count\-links"
108 Count the size of all files, even if they have appeared already
111 .B "\-L, \-\-dereference"
112 Dereference symbolic links (show the disk space used by the file
113 or directory that the link points to instead of the space used by
116 .B "\-m, \-\-megabytes"
117 Print sizes in MiB (binary megabytes, 1048576 bytes).
119 .BI "\-\-max\-depth=" n
120 Print the total for a directory (or file, with the
124 or fewer levels below the command line argument;
125 .BI "\-\-max\-depth=" 0
129 (New in file\%utils-4.0.)
131 .B "\-s, \-\-summarize"
132 Display only a total for each argument.
134 .B "\-S, \-\-separate\-dirs"
135 Report the size of each directory separately, not including the
136 sizes of subdirectories.
138 .B "\-x, \-\-one\-file\-system"
139 Skip directories that are on different filesystems from the one
140 that the argument being processed is on.
142 .BI "\-X " "file, " "\-\-exclude\-from=" "file"
145 except take the patterns to exclude from the specified
147 Patterns are listed one per line. If
149 is given as `\-', patterns are read from standard input.
150 (New in file\%utils-4.0.)
151 .SH "GNU STANDARD OPTIONS"
154 Print a usage message on standard output and exit successfully.
157 Print version information on standard output, then exit successfully.
160 Terminate option list.
164 reports sizes that are half the correct values
165 for files that are NFS-mounted from HP-UX systems. On HP-UX systems,
166 it reports sizes that are twice the correct values for files that are
167 NFS-mounted from BSD systems. This is due to a flaw in HP-UX; it also
172 The variable POSIXLY_CORRECT determines the choice of unit.
173 If it is not set, and the variable BLOCKSIZE has a value starting
174 with `HUMAN', then behaviour is as for the \-h option,
175 unless overridden by \-k or \-m options.
176 The variables LANG, LC_ALL, LC_CTYPE and LC_MESSAGES have the
183 as found in the file\%utils-4.0 package;
184 other versions may differ slightly.