1du(1B) SunOS/BSD Compatibility Package Commands du(1B)
2
3
4
6 du - display the number of disk blocks used per directory or file
7
9 /usr/ucb/du [-adkLr] [-o | -s] [filename]
10
11
13 The du utility gives the number of kilobytes contained in all files
14 and, recursively, directories within each specified directory or file
15 filename. If filename is missing, `.' (the current directory) is used.
16
17
18 A file that has multiple links to it is only counted once.
19
21 The following options are supported:
22
23 -a Generates an entry for each file.
24
25
26 -d Does not cross file system boundaries. For example, du -d /
27 reports usage only on the root partition.
28
29
30 -k Writes the files sizes in units of 1024 bytes, rather than the
31 default 512-byte units.
32
33
34 -L Processes symbolic links by using the file or directory that the
35 symbolic link references, rather than the link itself.
36
37
38 -o Does not add child directories' usage to a parent's total. With‐
39 out this option, the usage listed for a particular directory is
40 the space taken by the files in that directory, as well as the
41 files in all directories beneath it. This option does nothing if
42 the -s option is used.
43
44
45 -r Generates messages about directories that cannot be read, files
46 that cannot be opened, and so forth, rather than being silent
47 (the default).
48
49
50 -s Only displays the grand total for each of the specified file‐
51 names.
52
53
54
55 Entries are generated only for each directory in the absence of
56 options.
57
59 Example 1 Showing usage of all subdirectories in a directory
60
61
62 This example uses du in a directory. The pwd(1) command was used to
63 identify the directory, then du was used to show the usage of all the
64 subdirectories in that directory. The grand total for the directory is
65 the last entry in the display:
66
67
68 example% pwd
69 /usr/ralph/misc
70 example% du
71 5 ./jokes
72 33 ./squash
73 44 ./tech.papers/lpr.document
74 217 ./tech.papers/new.manager
75 401 ./tech.papers
76 144 ./memos
77 80 ./letters
78 388 ./window
79 93 ./messages
80 15 ./useful.news
81 1211 .
82
83
84
86 If any of the LC_* variables, that is, LC_CTYPE, LC_MESSAGES, LC_TIME,
87 LC_COLLATE, LC_NUMERIC, and LC_MONETARY (see environ(5)), are not set
88 in the environment, the operational behavior of du for each correspond‐
89 ing locale category is determined by the value of the LANG environment
90 variable. If LC_ALL is set, its contents are used to override both the
91 LANG and the other LC_* variables. If none of the above variables is
92 set in the environment, the "C" (U.S. style) locale determines how du
93 behaves.
94
95 LC_CTYPE Determines how du handles characters. When LC_CTYPE is
96 set to a valid value, du can display and handle text and
97 filenames containing valid characters for that locale.
98 du can display and handle Extended Unix Code (EUC) char‐
99 acters where any individual character can be 1, 2, or 3
100 bytes wide. du can also handle EUC characters of 1, 2,
101 or more column widths. In the "C" locale, only charac‐
102 ters from ISO 8859-1 are valid.
103
104
105 LC_MESSAGES Determines how diagnostic and informative messages are
106 presented. This includes the language and style of the
107 messages, and the correct form of affirmative and nega‐
108 tive responses. In the "C" locale, the messages are
109 presented in the default form found in the program
110 itself (in most cases, U.S. English).
111
112
114 See attributes(5) for descriptions of the following attributes:
115
116
117
118
119 ┌─────────────────────────────┬─────────────────────────────┐
120 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
121 ├─────────────────────────────┼─────────────────────────────┤
122 │Availability │SUNWscpu │
123 └─────────────────────────────┴─────────────────────────────┘
124
126 pwd(1), df(1M), du(1), quot(1M), attributes(5), environ(5)
127
129 Filename arguments that are not directory names are ignored, unless you
130 use -a.
131
132
133 If there are too many distinct linked files, du will count the excess
134 files more than once.
135
136
137
138SunOS 5.11 5 Jun 2001 du(1B)