Find images with specific pixel height/width and move them in another directory
3
votes
3
answers
627
views
I want to find screenshot files, having a specific pixel height of 2220 and width of 1080, and want to move them into another folder. That's nothing I can do manually, as the source is 100+k images or so.
I've found the following command, but not able to bring it to work:
find /Users/myuser/Desktop/daten/JPG -name "*.jpg" -exec bash -c "sips -g pixelHeight -g pixelWidth {} | grep -E '2220‘ >/dev/null" \; -exec mv {} /Users/myuser/Desktop/screenshots \;
Error message:
bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file
Thank you for your help.
UPDATE: fixed the command and removed the blank in the folder name to:
find /Users/myuser/Desktop/daten/JPG8 -name "*.jpg" -exec bash -c "sips -g pixelHeight -g pixelWidth {} | grep '2220' >/dev/null" \; -exec mv {} /Users/myuser/Desktop/screenshots \;
.. but still not working well - no files have been moved.
Asked by bjoern
(85 rep)
Sep 16, 2021, 08:03 AM
Last activity: Mar 8, 2025, 03:19 PM
Last activity: Mar 8, 2025, 03:19 PM