Bash tip: find the extensions of large files

April 23, 2010

I was exploring a site today with a webroot that filled more than 15 GBs. To see the full list of big files (>1 MB), I did:

find . -size +1024k

And to find the file extensions of the biggest files, I did:

find . -size +1024k | while read BIGFILE; do echo “$BIGFILE” | awk ‘{print tolower($0)}’ | awk -F . ‘{print $NF}’; done | sort | uniq