Find largest files recursively

command linedisk-usage

There seem to be a lot of entries about how to use du to recursively find the largest dir and files at the same time, but none on how to only recursively find the largest files in a set of directories.

Basically, I am looking for a command to find the largest .mp3 files in my music library, not the directory containing the most amount of data.

I'm using bash on an OSX 10.8 system.

Best Answer

I would use :

du -a Music/ | grep "\.mp3$" | sort -n | tail -n1

provided Music is your directory

Related Question