5

Find images by size: find / file / awk

view full story
linux-howto

http://unix.stackexchange.com – I've been trying to find png image files a certain height (over 500px). I know that file will return image dimensions. Example: $ file TestImg1a.png TestImg1a.png: PNG image data, 764 x 200, 4-bit colormap, non-interlaced But I need to use this to find all files in a directory with a height over 500px. I know how to print out all files regardless of height: find . -name '*.png' | xargs file | awk '{print $7 " " $1}' But how do I limit the $7 to those results greater than 500? (HowTos)