↑ ↓ select, Enter open, Esc close

Show the size of all subdirectories

Adjust the values, the command updates live
user@server
du -xh -d 1 /var/www/vhosts 2>/dev/null | sort -rh | head -20

Sums up the disk usage of each direct subdirectory and sorts by size in descending order. -x stays on one filesystem so mounted drives are not counted. Running it from the top down lets you find the space hog level by level.

Note: Without root, unreadable directories are missing and the total comes out too small.

Also searched as

  • which folder is the largest linux
  • show folder sizes
  • disk full which directory
  • disk usage per domain

Related one-liners

All in Filesystem

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.