Skip to content

Instantly share code, notes, and snippets.

@bttf
Last active December 13, 2017 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bttf/53c224ed52f3d2523db897587253d458 to your computer and use it in GitHub Desktop.
Save bttf/53c224ed52f3d2523db897587253d458 to your computer and use it in GitHub Desktop.
Filter JPG images in directory recursively that are only greater than 2400 width
find . -name '*.jpg' -exec magick identify -format '%w %d/%f\n' {} \; | awk 'int($1) > 2400 {for (i=2; i<=NF; i++) printf $i " "; print ""}' > output.log
while read -r line; do cp "$line" ../paintings/; done < output.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment