Essential Linux Storage Commands
Quick reference for checking storage space in Linux systems.
df Command (Disk Free)
Section titled “df Command (Disk Free)”Check mounted filesystem space:
df -h # All filesystems, human readabledf -h /home # Specific filesystemdf -hT # Include filesystem typesdu Command (Disk Usage)
Section titled “du Command (Disk Usage)”Check directory sizes:
du -sh /path # Single directory sizedu -h --max-depth=1 # First-level subdirectory sizesdu -sh * # All items in current directoryFind largest directories:
du -h | sort -rh | head -5 # Top 5 largestCommon flags:
-h: Human readable-s: Summary only-c: Show total--apparent-size: Actual file size
Remember to use sudo for system directories.