Linux Command Line – How to Find All Files with .log Extension and Order by File Size

command linefindlinuxsize;sort

I'm using CentOS 6.8

I'd like to know if I can I find all files with the .log extension and order by file size and display the file size next to the filename?

I'm currently using this command to find all files with the .log extension:

find .  -name \*.log

Best Answer

This seems to work for me:

find .  -name \*.log -ls | sort -r -n -k7
Related Question