IT Toolbox
Menu
Linux · Storage

Find large directories on Linux

Ranks top-level directories by size to help locate the source of disk saturation.

Low riskAdministrator rights may be required

Command

sudo du -xhd1 / 2>/dev/null | sort -h

When to use it

Run this after confirming that the root partition or another volume is nearly full.

How it works

  • -x stays on the same filesystem.
  • -d1 limits analysis to the first directory level.
  • sort -h sorts human-readable sizes.

Precautions

  • The scan can generate storage load on a large server.
  • Do not delete a system directory based on size alone.

Rollback

Read-only operation.

Support the development of BAOI Hosting, domains and new IT resources.
❤️ Support BAOI