DU(1)DU(1)

NAME

du – disk usage

SYNOPSIS

du [ -aefhnqstu ] [ -b size ] [ -p SI-prefix ] [ file ... ]

DESCRIPTION

Du gives the number of Kbytes allocated to data blocks of named files and, recursively, of files in named directories. It assumes storage is quantized in units of 1024 bytes (Kbytes) by default. Other values can be set by the -b option; size is the number of bytes, optionally suffixed k to specify multiplication by 1024. If file is missing, the current directory is used. The count for a directory includes the counts of the contained files and directories.

The -a option prints the number of blocks for every file in a directory. Normally counts are printed only for contained directories.

The -f option suppresses the printing of warning messages.

The -n option prints the size in bytes and the name of each file; it sets -a.

The -t option prints, in the format of du -n, the modified time of each file rather than the size. If the options -tu are specified then the accessed time is printed.

The -q option prints, in the format of du -n, the QID path of each file rather than the size.

The -s option causes du to descend the hierarchy as always, but to print only a summary line for each file.

The -e option causes du to print values (sizes, times or QID paths) in ‘scientific notation’ via print(2)’s %g.

The -h option causes du to print values (sizes, times or QID paths) in scientific notation, scaled to less than 1024, and with a suitable SI prefix (e.g., G for binary gigabytes).

The -p option causes du to print values (sizes, times or QID paths) in units of SI-prefix. Case is ignored when looking up SI-prefix. An empty SI-prefix corresponds to a scale factor of 1 (e.g., print sizes in bytes).

EXAMPLES

Print the size of /tmp in fractional binary gigabytes:

 

% du -sepg /tmp
 .6960154	/tmp

Print the size of /tmp in bytes and in scientific notation:

 

% du -sep '' /tmp
7.473408e+08	/tmp

SOURCE

/sys/src/cmd/du.c