Skip to main content
⚑ OpenDevDocs
Linux
linuxlinux-commandsReferenceBeginner

Estimate File Space Usage (du)

Calculate directory disk space, find large files, and diagnose disk usage with du.

Verified: 2026-09-30
Tested on:linux Ubuntu 24.04 / Debian 12
Platforms:
linuxmacos
#linux#du#disk#storage#cli

Command

du -sh * | sort -h


Short Description

du (Disk Usage) estimates and summarizes file and directory space consumption.


Examples

1. Summary Size of Current Directory (-sh)

du -sh .

2. List Sizes of All Subdirectories (1-Level Deep)

du -h --max-depth=1 /var

3. Find Top 10 Largest Folders in Directory

du -sh * | sort -hr | head -n 10

4. Exclude Specific Patterns

du -sh --exclude="*.log" /var/www

On this page