Tech Blog :: Bash tip: find the extensions of large files


Apr 23 '10 3:53pm
Tags

Bash tip: find the extensions of large files

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

Post new comment

Don't bother putting in spam links. They'll be set to rel=nofollow and will be removed and reported as spam shortly after submitting.

The content of this field is kept private and will not be shown publicly.
CAPTCHA
Are you human?