Print this page
7967 Want apparent size option for du(1)
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1/du.1
+++ new/usr/src/man/man1/du.1
1 1 '\" te
2 2 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
3 3 .\" Portions Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
4 +.\" Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.
4 5 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
5 6 .\" http://www.opengroup.org/bookstore/.
6 7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
7 8 .\" This notice shall appear on any product containing this material.
8 9 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
9 10 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
10 11 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
11 -.TH DU 1 "Feb 6, 2007"
12 +.TH DU 1 "March 14, 2017"
12 13 .SH NAME
13 14 du \- summarize disk usage
14 15 .SH SYNOPSIS
15 16 .LP
16 17 .nf
17 -\fB/usr/bin/du\fR [\fB-dorx\fR] [\fB-a\fR | \fB-s\fR] [\fB-h\fR | \fB-k\fR | \fB-m\fR] [\fB-H\fR | \fB-L\fR]
18 +\fB/usr/bin/du\fR [\fB-Adorx\fR] [\fB-a\fR | \fB-s\fR] [\fB-h\fR | \fB-k\fR | \fB-m\fR] [\fB-H\fR | \fB-L\fR]
18 19 [\fIfile\fR ...]
19 20 .fi
20 21
21 22 .LP
22 23 .nf
23 -\fB/usr/xpg4/bin/du\fR [\fB-dorx\fR] [\fB-a\fR | \fB-s\fR] [\fB-h\fR | \fB-k\fR | \fB-m\fR] [\fB-H\fR | \fB-L\fR]
24 +\fB/usr/xpg4/bin/du\fR [\fB-Adorx\fR] [\fB-a\fR | \fB-s\fR] [\fB-h\fR | \fB-k\fR | \fB-m\fR] [\fB-H\fR | \fB-L\fR]
24 25 [\fIfile\fR ...]
25 26 .fi
26 27
27 28 .SH DESCRIPTION
28 -.sp
29 29 .LP
30 30 The \fBdu\fR utility writes to standard output the size of the file space
31 31 allocated to, and the size of the file space allocated to each subdirectory of,
32 32 the file hierarchy rooted in each of the specified files. The size of the file
33 33 space allocated to a file of type directory is defined as the sum total of
34 34 space allocated to all files in the file hierarchy rooted in the directory plus
35 35 the space allocated to the directory itself. This sum will include the space
36 36 allocated to any extended attributes encountered.
37 -.sp
38 37 .LP
39 38 Files with multiple links will be counted and written for only one entry. The
40 39 directory entry that is selected in the report is unspecified. By default, file
41 40 sizes are written in 512-byte units, rounded up to the next 512-byte unit.
42 41 .SS "/usr/xpg4/bin/du"
43 -.sp
44 42 .LP
45 43 When \fBdu\fR cannot obtain file attributes or read directories (see
46 44 \fBstat\fR(2)), it will report an error condition and the final exit status
47 45 will be affected.
48 46 .SH OPTIONS
49 -.sp
50 47 .LP
51 48 The following options are supported for \fB/usr/bin/du\fR and
52 49 \fB/usr/xpg4/bin/du\fR:
53 50 .sp
54 51 .ne 2
55 52 .na
56 53 \fB\fB-a\fR\fR
57 54 .ad
58 55 .RS 6n
59 56 In addition to the default output, report the size of each file not of type
60 57 directory in the file hierarchy rooted in the specified file. Regardless of the
61 58 presence of the \fB-a\fR option, non-directories given as \fIfile\fR operands
62 59 will always be listed.
63 60 .RE
64 61
65 62 .sp
66 63 .ne 2
67 64 .na
65 +\fB\fB-A\fR\fR
66 +.ad
67 +.RS 6n
68 +Tally file size using the apparent size of the file instead of the disk blocks
69 +it occupies. This option is useful when operating on file systems which employ
70 +compression or in the presence of sparse files.
71 +.RE
72 +
73 +.sp
74 +.ne 2
75 +.na
68 76 \fB\fB-d\fR\fR
69 77 .ad
70 78 .RS 6n
71 79 Do not cross filesystem boundaries. For example, the command, \fBdu -d /\fR
72 80 reports usage only on the root partition.
73 81 .RE
74 82
75 83 .sp
76 84 .ne 2
77 85 .na
78 86 \fB\fB-h\fR\fR
79 87 .ad
80 88 .RS 6n
81 89 All sizes are scaled to a human readable format, for example, \fB14K\fR,
82 90 \fB234M\fR, \fB2.7G\fR, or \fB3.0T\fR. Scaling is done by repetitively dividing
83 91 by \fB1024\fR.
84 92 .RE
85 93
86 94 .sp
87 95 .ne 2
88 96 .na
89 97 \fB\fB-H\fR\fR
90 98 .ad
91 99 .RS 6n
92 100 If a symbolic link to a directory is specified on the command line, process the
93 101 symbolic link by using the directory which the symbolic link references, rather
94 102 than the link itself.
95 103 .RE
96 104
97 105 .sp
98 106 .ne 2
99 107 .na
100 108 \fB\fB-k\fR\fR
101 109 .ad
102 110 .RS 6n
103 111 Write the files sizes in units of 1024 bytes, rather than the default 512-byte
104 112 units.
105 113 .RE
106 114
107 115 .sp
108 116 .ne 2
109 117 .na
110 118 \fB\fB-L\fR\fR
111 119 .ad
112 120 .RS 6n
113 121 Process symbolic links by using the file or directory which the symbolic link
114 122 references, rather than the link itself.
115 123 .RE
116 124
117 125 .sp
118 126 .ne 2
119 127 .na
120 128 \fB\fB-m\fR\fR
121 129 .ad
122 130 .RS 6n
123 131 Write the files sizes in units of megabytes, rather than the default 512-byte
124 132 units.
125 133 .RE
126 134
127 135 .sp
128 136 .ne 2
129 137 .na
130 138 \fB\fB-o\fR\fR
131 139 .ad
132 140 .RS 6n
133 141 Do not add child directories' usage to a parent's total. Without this option,
134 142 the usage listed for a particular directory is the space taken by the files in
135 143 that directory, as well as the files in all directories beneath it. This option
136 144 does nothing if \fB-s\fR is used.
137 145 .RE
138 146
139 147 .sp
140 148 .ne 2
141 149 .na
142 150 \fB\fB-r\fR\fR
143 151 .ad
144 152 .RS 6n
145 153 Generate diagnostic messages about unreadable directories and files whose
146 154 status cannot be obtained. /usr/bin/du is silent if these conditions arise and
147 155 \fB-r\fR is not specified. \fB/usr/xpg4/bin/du\fR acts as though \fB-r\fR is
148 156 always specified.
149 157 .RE
150 158
151 159 .sp
152 160 .ne 2
153 161 .na
154 162 \fB\fB-s\fR\fR
155 163 .ad
156 164 .RS 6n
157 165 Instead of the default output, report only the total sum for each of the
158 166 specified files.
159 167 .RE
160 168
161 169 .sp
162 170 .ne 2
163 171 .na
164 172 \fB\fB-x\fR\fR
165 173 .ad
166 174 .RS 6n
167 175 When evaluating file sizes, evaluate only those files that have the same device
168 176 as the file specified by the file operand.
169 177 .RE
170 178
171 179 .sp
↓ open down ↓ |
94 lines elided |
↑ open up ↑ |
172 180 .LP
173 181 Specifying more than one of the options in the mutually exclusive pair,
174 182 \fB-H\fR and \fB-L\fR, is not considered an error. The last option specified
175 183 determines the output format.
176 184 .sp
177 185 .LP
178 186 Specifying more than one of the options in the mutually exclusive set of
179 187 options \fB-h\fR, \fB-k\fR, and \fB-m\fR is not considered an error. The last
180 188 option specified determines the output format.
181 189 .SH OPERANDS
182 -.sp
183 190 .LP
184 191 The following operand is supported:
185 192 .sp
186 193 .ne 2
187 194 .na
188 195 \fB\fIfile\fR\fR
189 196 .ad
190 197 .RS 8n
191 198 The path name of a file whose size is to be written. If no \fIfile\fR is
192 199 specified, the current directory is used.
193 200 .RE
194 -
195 201 .SH OUTPUT
196 -.sp
197 202 .LP
198 203 The output from \fBdu\fR consists of the amount of the space allocated to a
199 204 file and the name of the file.
200 205 .SH USAGE
201 -.sp
202 206 .LP
203 207 See \fBlargefile\fR(5) for the description of the behavior of \fBdu\fR when
204 208 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
205 209 .SH ENVIRONMENT VARIABLES
206 -.sp
207 210 .LP
208 211 See \fBenviron\fR(5) for descriptions of the following environment variables
209 212 that affect the execution of \fBdu\fR: \fBLANG\fR, \fBLC_ALL\fR,
210 213 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
211 214 .SH EXIT STATUS
212 -.sp
213 215 .LP
214 216 The following exit values are returned:
215 217 .sp
216 218 .ne 2
217 219 .na
218 220 \fB\fB0\fR\fR
219 221 .ad
220 222 .RS 6n
221 223 Successful completion.
222 224 .RE
223 -
224 225 .sp
225 226 .ne 2
226 227 .na
227 228 \fB\fB>0\fR\fI\fR\fR
228 229 .ad
229 230 .RS 6n
230 231 An error occurred.
231 232 .RE
232 -
233 233 .SH ATTRIBUTES
234 -.sp
235 234 .LP
236 235 See \fBattributes\fR(5) for descriptions of the following attributes:
237 236 .SS "/usr/bin/du"
238 -.sp
239 237
240 -.sp
241 238 .TS
242 239 box;
243 240 c | c
244 241 l | l .
245 242 ATTRIBUTE TYPE ATTRIBUTE VALUE
246 243 _
247 244 CSI Enabled
248 245 _
249 246 Interface Stability Stable
250 247 .TE
251 248
252 249 .SS "/usr/xpg4/bin/du"
253 -.sp
254 250
255 -.sp
256 251 .TS
257 252 box;
258 253 c | c
259 254 l | l .
260 255 ATTRIBUTE TYPE ATTRIBUTE VALUE
261 256 _
262 257 CSI Enabled
263 258 _
264 259 Interface Stability Standard
265 260 .TE
266 261
267 262 .SH SEE ALSO
268 -.sp
269 263 .LP
270 264 \fBls\fR(1), \fBstat\fR(2), \fBattributes\fR(5), \fBenviron\fR(5),
271 265 \fBfsattr\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
272 -.sp
273 266 .LP
274 267 \fISystem Administration Guide: Basic Administration\fR
275 268 .SH NOTES
276 -.sp
277 269 .LP
278 270 A file with two or more links is counted only once. If, however, there are
279 271 links between files in different directories where the directories are on
280 272 separate branches of the file system hierarchy, \fBdu\fR will count the excess
281 273 files more than once.
282 -.sp
283 274 .LP
284 -Files containing holes will result in an incorrect block count.
275 +Files containing holes will result in an incorrect block count. In this case,
276 +one may use the \fB-A\fR option to report file sizes by their apparent size
277 +instead.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX