du

Disk Usage. Estimates file space usage. Useful for finding what is taking up space in a directory.

Synopsis

du [options] [file]...

Core Options

-h

Human readable sizes (e.g., 1K 234M 2G).

-s

Summarize. Display only a total for each argument.

-d N

Max depth. Print the total for a directory (or file, with --all) only if it is N or fewer levels below the command line argument.

Usage Examples

Summary of Current Directory

Show the total size of the current folder.

du -sh .

List Subdirectories

Show size of top-level subdirectories only.

du -h -d 1

Find Largest Directories

List subdirectories sorted by size.

du -h -d 1 | sort -hr
Built for builders.