du(C)


du -- summarize disk usage

Syntax

du [ -afkrsuVx ] [ names ]

Description

The du command gives the number of blocks contained in all files and directories recursively within each directory and file specified by the list in the names argument. The block count includes the indirect blocks of the file. If names is not supplied, the current directory is used.


NOTE: "Indirect blocks" refers to blocks used by the filesystem to store pointers to the actual data blocks that are part of the file. Hence for large files (that is, those which use large numbers of pointers), the du command reports disk usage larger than simply the data blocks associated with the file contents.

du has the following options:


-a
causes an entry to be generated for each file. Without the -a option, the default behavior is to output the block count for directories and those files explicitly named by the names argument.

-f
has the same effect as the -x option.

-k
causes du to report in units of 1024 bytes. The default is to report in units of 512 bytes.

-r
causes du to report directories that cannot be read, files that cannot be opened, and so on. This option is obsolete since this is now the default behavior of du.

-s
causes only the grand total (for each of the specified names) to be given.

-u
causes du to ignore files that have more than one link.

-V
causes du to display a three-column output reporting the space usage for versioned files. The first column displays the current space taken up by files in the directory. The second shows the space taken up by previous files, that is, files which have been deleted and the space shown is that used by the hidden versioned file(s). The third is the total of the first and second columns, providing usage information for versioned files.

-x
causes du to display the usage of files in the current filesystem only. Directories containing mounted filesystems will be ignored.
A file with two or more links is only counted once. Symbolic links are not followed, but the disk space used to hold the actual symbolic link is counted.

By default, this utility reports sizes in 512-byte blocks. du interprets 1 block from a 1024-byte block system as 2 of its own 512-byte blocks; thus, du would report a 500-byte file as using 2 blocks rather than 1.

Exit values

du returns the following values:

0
successful completion

>0
an error occurred

Limitations

Files containing holes will cause an incorrect block count.

Files


/bin/du
du executable file

See also

df(C), quot(ADM)

Standards conformance

du is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.

Notices

A version of du that can handle files greater than 2GB is available in /u95/bin. See du(1M) for more information.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005