du(1) du(1)
NAME
du - summarize disk usage
SYNOPSIS
du [option ...] [name ...]
DESCRIPTION
du outputs the amount of disk space used by directories, subdirec-
tories, and ordinary files in blocks of 512 bytes.
OPTIONS
No option specified:
If name is a directory, du lists the space occupied by the speci-
fied directory and all its subdirectories. The disk space occu-
pied by ordinary files in the specified directory is included in
the count, but not listed individually.
-a If name is a directory, du individually lists the space occupied
by all the files in it and its subdirectories.
-k du outputs the amount of disk space in blocks of 1024 bytes.
-r If name designates a directory for which you do not have read
permission, or a file that cannot be opened, du issues an error
message.
-r is always set implicitly and for reasons of compatibility is
only available as an option.
-s du displays only the grand total of disk space used by the named
file or subtree.
-s must not be combined with -a.
-x If file is a directory, du only lists the space occupied by the
subdirectories and files belonging to the same file system as
file.
-- If name begins with a dash (-), the end of the command-line
options must be marked with --.
name Name of the file or directory for which disk usage is to be
displayed. A file with two or more links is only counted once. A
file that has a hole in it (e.g. if only block 1 and block 100
are used) will result in an incorrect block count.
name not specified:
The disk space occupied by the current directory and all its sub-
directories is displayed.
Page 1 Reliant UNIX 5.44 Printed 11/98
du(1) du(1)
LOCALE
The LCMESSAGES environment variable governs the language in which
message texts are displayed. If LCMESSAGES is undefined or is defined
as the null string, it defaults to the value of LANG. If LANG is like-
wise undefined or null, the system acts as if it were not internation-
alized.
The LCALL environment variable governs the entire locale. LCALL
takes precedence over all the other environment variables which affect
internationalization.
EXAMPLES
Example 1
List the disk usage, in 512-byte blocks, of all subdirectories of the
current directory whose names begin with DIR. The space occupied by
ordinary files is included, but not listed individually.
$ du DIR*
6 DIR-1
136 DIR-2/SUB-1
140 DIR-2
5 DIR-3
54 DIR-4
52 DIR-5
Example 2
List the disk usage, in 512-byte blocks, of all subdirectories of the
current directory whose names begin with DIR. The disk usage of ordi-
nary files is listed individually in this case because the -a option
is used.
$ du -a DIR*
1 DIR-1/file1
1 DIR-1/file2
1 DIR-1/file3
6 DIR-1
0 DIR-2/file4
1 DIR-2/file5
34 DIR-2/SUB-1/file6
99 DIR-2/SUB-1/file7
136 DIR-2/SUB-1
140 DIR-2
1 DIR-3/file8
1 DIR-3/file9
5 DIR-3
50 DIR-4/file10
1 DIR-4/file10.bak
54 DIR-4
50 DIR-5/file11
52 DIR-5
Page 2 Reliant UNIX 5.44 Printed 11/98
du(1) du(1)
SEE ALSO
df(1), ls(1).
Page 3 Reliant UNIX 5.44 Printed 11/98