Linux: Show Directory Size: du

By Xah Lee. Date: . Last updated: .

To show size of a directory, use du command.

How to find the size of a dir?

# show dir size of current dir
du --si -s .

How to find the size of all top-level subdirs?

# show size of current dir, human readable, 1st level dirs, sort by size.
du --si -d1 | sort -h
# show size of current dir, 1st level dirs, sort by size.
du -d1 | sort -n

Most important options:

Human readable forms. (kilo, mega, giga)

Specify your own units:

When using “sort”, use -n to sort by number, use -h to sort human readable form of number.

Directory Tree

See also: Linux: View Directory as Tree