Last month, I was trying to free up some space in my company servers and I realized that there were a lot of .zip files taking up a lot of space.

So, I wrote the following command to list files by their extension:

find . -iname \*.extension -exec du -sh {} \; > file-list.txt

And later to determine which files are the largest, I executed this command to sort the list by file size:

sort -rh file-list.txt > newfile.txt

Hope this tip helps you too! 😄