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.
sipsruns in its own shell, when this shell is terminated its output{}is lost. Either use a tmpfile, export a variable or try to redefine your command.grep -E '2220‘