IT Toolbox

Identify large folders under Linux

View my favorites
Linux Low risk Administrator required

Identify large folders under Linux

Classifies the main root files according to their size to find the source of saturation.

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

When should you use it?

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

What the script does

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

♡ 0