1 '\" te 2 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved. 3 .\" Portions Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved. 4 .\" 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 .\" http://www.opengroup.org/bookstore/. 6 .\" 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 .\" This notice shall appear on any product containing this material. 8 .\" 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 .\" 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 .\" 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 .SH NAME 13 du \- summarize disk usage 14 .SH SYNOPSIS 15 .LP 16 .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 [\fIfile\fR ...] 19 .fi 20 21 .LP 22 .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 [\fIfile\fR ...] 25 .fi 26 27 .SH DESCRIPTION 28 .sp 29 .LP 30 The \fBdu\fR utility writes to standard output the size of the file space 31 allocated to, and the size of the file space allocated to each subdirectory of, 32 the file hierarchy rooted in each of the specified files. The size of the file 33 space allocated to a file of type directory is defined as the sum total of 34 space allocated to all files in the file hierarchy rooted in the directory plus 35 the space allocated to the directory itself. This sum will include the space 36 allocated to any extended attributes encountered. 37 .sp 38 .LP 39 Files with multiple links will be counted and written for only one entry. The 40 directory entry that is selected in the report is unspecified. By default, file 41 sizes are written in 512-byte units, rounded up to the next 512-byte unit. 42 .SS "/usr/xpg4/bin/du" 43 .sp 44 .LP 45 When \fBdu\fR cannot obtain file attributes or read directories (see 46 \fBstat\fR(2)), it will report an error condition and the final exit status 47 will be affected. 48 .SH OPTIONS 49 .sp 50 .LP 51 The following options are supported for \fB/usr/bin/du\fR and 52 \fB/usr/xpg4/bin/du\fR: 53 .sp 54 .ne 2 55 .na 56 \fB\fB-a\fR\fR 57 .ad 58 .RS 6n 59 In addition to the default output, report the size of each file not of type 60 directory in the file hierarchy rooted in the specified file. Regardless of the 61 presence of the \fB-a\fR option, non-directories given as \fIfile\fR operands 62 will always be listed. 63 .RE 64 65 .sp 66 .ne 2 67 .na 68 \fB\fB-d\fR\fR 69 .ad 70 .RS 6n 71 Do not cross filesystem boundaries. For example, the command, \fBdu -d /\fR 72 reports usage only on the root partition. 73 .RE 74 75 .sp 76 .ne 2 77 .na 78 \fB\fB-h\fR\fR 79 .ad 80 .RS 6n 81 All sizes are scaled to a human readable format, for example, \fB14K\fR, 82 \fB234M\fR, \fB2.7G\fR, or \fB3.0T\fR. Scaling is done by repetitively dividing 83 by \fB1024\fR. 84 .RE 85 86 .sp 87 .ne 2 88 .na 89 \fB\fB-H\fR\fR 90 .ad 91 .RS 6n 92 If a symbolic link to a directory is specified on the command line, process the 93 symbolic link by using the directory which the symbolic link references, rather 94 than the link itself. 95 .RE 96 97 .sp 98 .ne 2 99 .na 100 \fB\fB-k\fR\fR 101 .ad 102 .RS 6n 103 Write the files sizes in units of 1024 bytes, rather than the default 512-byte 104 units. 105 .RE 106 107 .sp 108 .ne 2 109 .na 110 \fB\fB-L\fR\fR 111 .ad 112 .RS 6n 113 Process symbolic links by using the file or directory which the symbolic link 114 references, rather than the link itself. 115 .RE 116 117 .sp 118 .ne 2 119 .na 120 \fB\fB-m\fR\fR 121 .ad 122 .RS 6n 123 Write the files sizes in units of megabytes, rather than the default 512-byte 124 units. 125 .RE 126 127 .sp 128 .ne 2 129 .na 130 \fB\fB-o\fR\fR 131 .ad 132 .RS 6n 133 Do not add child directories' usage to a parent's total. Without this option, 134 the usage listed for a particular directory is the space taken by the files in 135 that directory, as well as the files in all directories beneath it. This option 136 does nothing if \fB-s\fR is used. 137 .RE 138 139 .sp 140 .ne 2 141 .na 142 \fB\fB-r\fR\fR 143 .ad 144 .RS 6n 145 Generate diagnostic messages about unreadable directories and files whose 146 status cannot be obtained. /usr/bin/du is silent if these conditions arise and 147 \fB-r\fR is not specified. \fB/usr/xpg4/bin/du\fR acts as though \fB-r\fR is 148 always specified. 149 .RE 150 151 .sp 152 .ne 2 153 .na 154 \fB\fB-s\fR\fR 155 .ad 156 .RS 6n 157 Instead of the default output, report only the total sum for each of the 158 specified files. 159 .RE 160 161 .sp 162 .ne 2 163 .na 164 \fB\fB-x\fR\fR 165 .ad 166 .RS 6n 167 When evaluating file sizes, evaluate only those files that have the same device 168 as the file specified by the file operand. 169 .RE 170 171 .sp 172 .LP 173 Specifying more than one of the options in the mutually exclusive pair, 174 \fB-H\fR and \fB-L\fR, is not considered an error. The last option specified 175 determines the output format. 176 .sp 177 .LP 178 Specifying more than one of the options in the mutually exclusive set of 179 options \fB-h\fR, \fB-k\fR, and \fB-m\fR is not considered an error. The last 180 option specified determines the output format. 181 .SH OPERANDS 182 .sp 183 .LP 184 The following operand is supported: 185 .sp 186 .ne 2 187 .na 188 \fB\fIfile\fR\fR 189 .ad 190 .RS 8n 191 The path name of a file whose size is to be written. If no \fIfile\fR is 192 specified, the current directory is used. 193 .RE 194 195 .SH OUTPUT 196 .sp 197 .LP 198 The output from \fBdu\fR consists of the amount of the space allocated to a 199 file and the name of the file. 200 .SH USAGE 201 .sp 202 .LP 203 See \fBlargefile\fR(5) for the description of the behavior of \fBdu\fR when 204 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). 205 .SH ENVIRONMENT VARIABLES 206 .sp 207 .LP 208 See \fBenviron\fR(5) for descriptions of the following environment variables 209 that affect the execution of \fBdu\fR: \fBLANG\fR, \fBLC_ALL\fR, 210 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR. 211 .SH EXIT STATUS 212 .sp 213 .LP 214 The following exit values are returned: 215 .sp 216 .ne 2 217 .na 218 \fB\fB0\fR\fR 219 .ad 220 .RS 6n 221 Successful completion. 222 .RE 223 224 .sp 225 .ne 2 226 .na 227 \fB\fB>0\fR\fI\fR\fR 228 .ad 229 .RS 6n 230 An error occurred. 231 .RE 232 233 .SH ATTRIBUTES 234 .sp 235 .LP 236 See \fBattributes\fR(5) for descriptions of the following attributes: 237 .SS "/usr/bin/du" 238 .sp 239 240 .sp 241 .TS 242 box; 243 c | c 244 l | l . 245 ATTRIBUTE TYPE ATTRIBUTE VALUE 246 _ 247 CSI Enabled 248 _ 249 Interface Stability Stable 250 .TE 251 252 .SS "/usr/xpg4/bin/du" 253 .sp 254 255 .sp 256 .TS 257 box; 258 c | c 259 l | l . 260 ATTRIBUTE TYPE ATTRIBUTE VALUE 261 _ 262 CSI Enabled 263 _ 264 Interface Stability Standard 265 .TE 266 267 .SH SEE ALSO 268 .sp 269 .LP 270 \fBls\fR(1), \fBstat\fR(2), \fBattributes\fR(5), \fBenviron\fR(5), 271 \fBfsattr\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5) 272 .sp 273 .LP 274 \fISystem Administration Guide: Basic Administration\fR 275 .SH NOTES 276 .sp 277 .LP 278 A file with two or more links is counted only once. If, however, there are 279 links between files in different directories where the directories are on 280 separate branches of the file system hierarchy, \fBdu\fR will count the excess 281 files more than once. 282 .sp 283 .LP 284 Files containing holes will result in an incorrect block count.