1 min read

Find what's eating disk space on Linux


Where did all the space go?

Top 10 largest directories:

du_top.sh
du -h --max-depth=1 / 2>/dev/null | sort -rh | head -10

Largest files anywhere:

find_large.sh
find / -xdev -type f -size +100M -exec ls -lh {} \; 2>/dev/null | sort -k5 -rh | head -10

For an interactive view, install ncdu:

ncdu.sh
ncdu /

Check inode usage (sometimes you run out of inodes, not space):

inodes.sh
df -i