[SOLVED] Tech support request: Finding the biggest files of a specific type

kfwyre
2021-04-10T19:28:55Z

Hey Tildes!

I need some help with a specific tech issue, and I'm sure someone here can help me do it way quicker than I would be able to on my own.

General Request

I'd like to be able to scan a directory and find all of the largest files of a specific type (e.g. the largest .jpg files). I'm running Pop!_OS and I'm assuming there's some way to do this in the terminal, or alternately some utility I could use.

More Specific Details

I'm cleaning up my digital music library, and I realized in setting it up I made some errors by saving some very high res cover art. Many of my Bandcamp purchases come with a cover.jpg or cover.png file that is several megabytes large. I made the mistake of writing these into the files (adding, for some albums, an extra, say, 100 MB across all tracks). They also take a lot longer to load when I pull them up in my cloud music player. I'd like to be able to identify the albums with the largest cover.* files so that I can go in and replace the album art with a lower res version and gain back all that wasted space lost to unnecessary duplication.

I could go folder by folder and take a look at the sizes of each, but I figure there's an easier way to surface the ones that need my attention. Everything I've looked at online so far has helped me figure out how to identify the biggest files in general, but all that will do is surface the actual audio files, when it's the cover art that needs the specific attention.

Also, in case it's necessary information, the directory structure is Music/[artist]/[album]/cover.*

Any help will be very appreciated!

Comments URL: https://tildes.net/~tech/w5w/solved_tech_support_request_finding_the_biggest_files_of_a_specific_type

Votes: 12

Comments: 26