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