Disk Usage in Linux

From the Linux Essential Commands cheat sheet · System Information · verified Jul 2026

Disk Usage

Check disk space and directory sizes

bash
# Disk space by filesystem
df -h

# Directory sizes
du -h directory/
du -sh directory/      # Summary only
du -h --max-depth=1    # One level deep

# Largest files/dirs
du -ah | sort -rh | head -20
✅ df -h shows available space on all mounted filesystems
💡 du -sh gives total size of a directory
🔍 -h makes sizes human-readable (GB, MB, KB)
diskstoragespace

Continue with Linux Essential Commands

Save the full cheat sheet or work through every related task.

More Linux tasks

Back to the full Linux Essential Commands cheat sheet