du Command Purpose Summarizes disk usage. Syntax du [ -k ] [ -l ] [ -r ] [ -s ] [ -a [ File ... ] ] [ Directory ... ] Description The du command displays the number of blocks for files and direc- tories specified by the File and Directory parameters, and recur- sively, for all directories within the specified Directory param- eter. Specifying the -a flag reports the number of blocks in individual files. The block count includes indirect blocks of each file. Block count is calculated in 512-byte units indepen- dent of the cluster size used by the system. Specifying the -k flag calculates the block count in 1024-byte units. If no File or Directory parameter is provided, the du command uses the current directory. Notes: 1. If the -a flag is not specified, the du command does not re- port on any individual files. 2. If there are too many distinctly linked files, the du command counts the excess files more than once. 3. Block counts are based only on file size; therefore, unallo- cated blocks are not accounted for in the reported block counts. Flags -a Displays disk use for each file. -k Calculates the block count in 1024-byte units rather than the default 512-byte units. -l Allocates blocks evenly among the links for files with multi- ple links. By default, a file with two or more links is counted only once. -r Reports names of inaccessible files and directories. If this flag is not specified, inaccessible files or directories are not reported. -s Displays only the total sum (for each of the specified files or directories given). Exit Status This command returns the following exit values: 0 Successful completion. >0 An error occurred. Examples 1. To summarize the disk usage of a directory tree and each of its subtrees, enter: du /home/fran This displays the number of disk blocks in the /home/fran directory and each of its subdirectories. 2. To display the disk usage of each file, enter: du -a /home/fran This displays the number of disk blocks contained in each file and subdirectory of the /home/fran directory. The number beside a directory is the disk usage of that directory tree. The number beside a regular file is the disk usage of that file alone. 3. To display only the total disk usage of a directory tree, enter: du -rs /home/fran The -s flag instructs the du command to display only the sum to- tal disk usage of the /home/fran directory and the files it con- tains. The -r flag tells the du command to display an error message if it cannot read a file or directory. Implementation Specifics This command is part of Base Operating System (BOS) Runtime. Files usr/bin/du Path to the du command. Related Information The Directory Overview in AIX Version 3.2 System User's Guide: Base and Devices explains working with directories and path names. The Files Overview in AIX Version 3.2 System User's Guide: Base and Devices provides information on working with files. The df command.