]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man1/du.1
Import of man-pages 1.70
[thirdparty/man-pages.git] / man1 / du.1
1 .\" Copyright Andries Brouwer, Ragnar Hojland Espinosa and A. Wik, 1998.
2 .\"
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.
6 .\"
7 .TH DU 1 1998-11 "GNU fileutils 4.0"
8 .SH NAME
9 du \- estimate file space usage
10 .SH SYNOPSIS
11 .BI "du [" options "] [" file... ]
12 .sp
13 POSIX options:
14 .B "[\-askx] [\-\-]"
15 .sp
16 GNU options (shortest form):
17 .B [\-abcDhHklLmsSxX]
18 .BI "[\-\-block\-size=" size ]
19 .BI "[\-\-exclude=" pattern ]
20 .BI "[\-\-max\-depth=" n ]
21 .B "[\-\-help] [\-\-version] [\-\-]"
22 .SH DESCRIPTION
23 .B du
24 reports the amount of disk space used by the specified files,
25 and by each directory in the hierarchies rooted at the
26 specified files.
27 Here `disk space used' means space used for the entire
28 file hierarchy below the specified file.
29 .PP
30 With no arguments,
31 .B du
32 reports the disk space for the current directory.
33 .SH "POSIX DETAILS"
34 The output is in 512-byte units by default, but in
35 1024-byte units when the \-k option is given.
36 .SH "GNU DETAILS"
37 The output is in 1024-byte units (when no units are
38 specified by options), unless the environment variable
39 .B POSIXLY_CORRECT
40 is set, in which case POSIX is followed.
41 .SH "POSIX OPTIONS"
42 .TP
43 .B "\-a"
44 Show counts for all files encountered, not just directories.
45 .TP
46 .B "\-k"
47 Use 1024-byte units instead of the default 512-byte units.
48 .TP
49 .B "\-s"
50 Only output space usage for the actual arguments given,
51 not for their subdirectories.
52 .TP
53 .B "\-x"
54 Only count space on the same device as the argument given.
55 .TP
56 .B "\-\-"
57 Terminate option list.
58 .SH "GNU OPTIONS"
59 .TP
60 .B "\-a, \-\-all"
61 Show counts for all files, not just directories.
62 .TP
63 .B "\-b, \-\-bytes"
64 Print sizes in bytes, instead of kilobytes.
65 .TP
66 .BI "\-\-block\-size=" size
67 Print sizes in blocks of
68 .I size
69 bytes.
70 (New in file\%utils-4.0.)
71 .TP
72 .B "\-c, \-\-total"
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.
76 .TP
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
81 .IR /usr/tmp ,
82 which are often symbolic links.
83 .TP
84 .BI "\-\-exclude=" pattern
85 When recursing, skip subdirectories or files matching
86 .IR pattern .
87 The
88 .I pattern
89 may be any standard Bourne shell file glob pattern.
90 (New in file\%utils-4.0.)
91 .TP
92 .B "\-h, \-\-human\-readable"
93 Append a size letter, such as
94 .B M
95 for binary megabytes (`mebibytes'), to each size.
96 .TP
97 .B "\-H, \-\-si"
98 Do the same as for
99 .BR \-h ,
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.)
103 .TP
104 .B "\-k, \-\-kilobytes"
105 Print sizes in KiB (binary kilobytes, 1024 bytes).
106 .TP
107 .B "\-l, \-\-count\-links"
108 Count the size of all files, even if they have appeared already
109 (as a hard link).
110 .TP
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
114 the link).
115 .TP
116 .B "\-m, \-\-megabytes"
117 Print sizes in MiB (binary megabytes, 1048576 bytes).
118 .TP
119 .BI "\-\-max\-depth=" n
120 Print the total for a directory (or file, with the
121 .B \-a
122 flag) only if it is
123 .I n
124 or fewer levels below the command line argument;
125 .BI "\-\-max\-depth=" 0
126 is the same as the
127 .B \-s
128 flag.
129 (New in file\%utils-4.0.)
130 .TP
131 .B "\-s, \-\-summarize"
132 Display only a total for each argument.
133 .TP
134 .B "\-S, \-\-separate\-dirs"
135 Report the size of each directory separately, not including the
136 sizes of subdirectories.
137 .TP
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.
141 .TP
142 .BI "\-X " "file, " "\-\-exclude\-from=" "file"
143 Like
144 .BR \-\-exclude ,
145 except take the patterns to exclude from the specified
146 .IR file .
147 Patterns are listed one per line. If
148 .I file
149 is given as `\-', patterns are read from standard input.
150 (New in file\%utils-4.0.)
151 .SH "GNU STANDARD OPTIONS"
152 .TP
153 .B "\-\-help"
154 Print a usage message on standard output and exit successfully.
155 .TP
156 .B "\-\-version"
157 Print version information on standard output, then exit successfully.
158 .TP
159 .B "\-\-"
160 Terminate option list.
161 .SH BUGS
162 On BSD systems,
163 .B du
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
168 affects the HP-UX
169 .B du
170 program.
171 .SH ENVIRONMENT
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
177 usual meaning.
178 .SH "CONFORMING TO"
179 POSIX 1003.2
180 .SH NOTES
181 This page describes
182 .B du
183 as found in the file\%utils-4.0 package;
184 other versions may differ slightly.