I have a web server where I have run out of space and it's causing issues with the wordpress sites I am running on them.
I know that I have a lot of large .png files (the fact it's png is a mistake in itself but let's not get into that).
I would to get the list of png or jpg files that are in the server and sort them by decreasing size. I know I can use ls -SlahR
but the sorting is on a per folder basis.
I then came up with find . -name "*.png" | xargs -i -n1 ls -lah {}
which is ok except that (a) it doesn't sort the lines and (b) it shows the file permissions and ownerships which I couldn't care less about.
So is there something better? Something that would produce [size] [path_to_file]?