Solaris Advanced User's Guide

Displaying Directory Usage (du)

You can use du to display the usage of a directory and all its subdirectories in units of 512 bytes or characters.

du shows you the disk usage in each subdirectory. For a list of subdirectories in a file system, change the directory to the path name that is associated with that file system. Then run the following pipeline:


$ du | sort -r -n

This pipeline, which uses the reverse (-r) and numeric (-n) options of the sort command, identifies large directories. Use ls -l to examine the size (in bytes) and modification times of files within each directory. Old files and text files larger 100 KBytes might warrant storage offline.