Linux: Show Directory Size: du

By Xah Lee. Date: . Last updated: .

To show size of a directory, use du command.

Find the Size of a Dir

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

Find 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.

If you have a question, put $5 at patreon and message me.

Linux Shell Basics

Sys Admin

Bash/Terminal

Linux Desktop