1 DU(1) User Commands DU(1) 2 3 4 5 NAME 6 du - summarize disk usage 7 8 SYNOPSIS 9 /usr/bin/du [-Adorx] [-a | -s] [-h | -k | -m] [-H | -L] 10 [file ...] 11 12 13 /usr/xpg4/bin/du [-Adorx] [-a | -s] [-h | -k | -m] [-H | -L] 14 [file ...] 15 16 17 DESCRIPTION 18 The du utility writes to standard output the size of the file space 19 allocated to, and the size of the file space allocated to each 20 subdirectory of, the file hierarchy rooted in each of the specified 21 files. The size of the file space allocated to a file of type directory 22 is defined as the sum total of space allocated to all files in the file 23 hierarchy rooted in the directory plus the space allocated to the 24 directory itself. This sum will include the space allocated to any 25 extended attributes encountered. 26 27 Files with multiple links will be counted and written for only one 28 entry. The directory entry that is selected in the report is 29 unspecified. By default, file sizes are written in 512-byte units, 30 rounded up to the next 512-byte unit. 31 32 /usr/xpg4/bin/du 33 When du cannot obtain file attributes or read directories (see 34 stat(2)), it will report an error condition and the final exit status 35 will be affected. 36 37 OPTIONS 38 The following options are supported for /usr/bin/du and 39 /usr/xpg4/bin/du: 40 41 -a 42 In addition to the default output, report the size of each file 43 not of type directory in the file hierarchy rooted in the 44 specified file. Regardless of the presence of the -a option, non- 45 directories given as file operands will always be listed. 46 47 48 -A 49 Tally file size using the apparent size of the file instead of 50 the disk blocks it occupies. This option is useful when operating 51 on file systems which employ compression or in the presence of 52 sparse files. 53 54 55 -d 56 Do not cross filesystem boundaries. For example, the command, du 57 -d / reports usage only on the root partition. 58 59 60 -h 61 All sizes are scaled to a human readable format, for example, 62 14K, 234M, 2.7G, or 3.0T. Scaling is done by repetitively 63 dividing by 1024. 64 65 66 -H 67 If a symbolic link to a directory is specified on the command 68 line, process the symbolic link by using the directory which the 69 symbolic link references, rather than the link itself. 70 71 72 -k 73 Write the files sizes in units of 1024 bytes, rather than the 74 default 512-byte units. 75 76 77 -L 78 Process symbolic links by using the file or directory which the 79 symbolic link references, rather than the link itself. 80 81 82 -m 83 Write the files sizes in units of megabytes, rather than the 84 default 512-byte units. 85 86 87 -o 88 Do not add child directories' usage to a parent's total. Without 89 this option, the usage listed for a particular directory is the 90 space taken by the files in that directory, as well as the files 91 in all directories beneath it. This option does nothing if -s is 92 used. 93 94 95 -r 96 Generate diagnostic messages about unreadable directories and 97 files whose status cannot be obtained. /usr/bin/du is silent if 98 these conditions arise and -r is not specified. /usr/xpg4/bin/du 99 acts as though -r is always specified. 100 101 102 -s 103 Instead of the default output, report only the total sum for each 104 of the specified files. 105 106 107 -x 108 When evaluating file sizes, evaluate only those files that have 109 the same device as the file specified by the file operand. 110 111 112 113 Specifying more than one of the options in the mutually exclusive pair, 114 -H and -L, is not considered an error. The last option specified 115 determines the output format. 116 117 118 Specifying more than one of the options in the mutually exclusive set 119 of options -h, -k, and -m is not considered an error. The last option 120 specified determines the output format. 121 122 OPERANDS 123 The following operand is supported: 124 125 file 126 The path name of a file whose size is to be written. If no file 127 is specified, the current directory is used. 128 129 OUTPUT 130 The output from du consists of the amount of the space allocated to a 131 file and the name of the file. 132 133 USAGE 134 See largefile(5) for the description of the behavior of du when 135 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). 136 137 ENVIRONMENT VARIABLES 138 See environ(5) for descriptions of the following environment variables 139 that affect the execution of du: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, 140 and NLSPATH. 141 142 EXIT STATUS 143 The following exit values are returned: 144 145 0 146 Successful completion. 147 148 >0 149 An error occurred. 150 151 ATTRIBUTES 152 See attributes(5) for descriptions of the following attributes: 153 154 /usr/bin/du 155 156 +--------------------+-----------------+ 157 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 158 +--------------------+-----------------+ 159 |CSI | Enabled | 160 +--------------------+-----------------+ 161 |Interface Stability | Stable | 162 +--------------------+-----------------+ 163 164 /usr/xpg4/bin/du 165 166 +--------------------+-----------------+ 167 | ATTRIBUTE TYPE | ATTRIBUTE VALUE | 168 +--------------------+-----------------+ 169 |CSI | Enabled | 170 +--------------------+-----------------+ 171 |Interface Stability | Standard | 172 +--------------------+-----------------+ 173 174 SEE ALSO 175 ls(1), stat(2), attributes(5), environ(5), fsattr(5), largefile(5), 176 standards(5) 177 178 System Administration Guide: Basic Administration 179 180 NOTES 181 A file with two or more links is counted only once. If, however, there 182 are links between files in different directories where the directories 183 are on separate branches of the file system hierarchy, du will count 184 the excess files more than once. 185 186 Files containing holes will result in an incorrect block count. In this 187 case, one may use the -A option to report file sizes by their apparent 188 size instead. 189 190 191 192 March 14, 2017 DU(1)