Skip to content

Instantly share code, notes, and snippets.

@MoralCode
Last active January 30, 2021 03:57
Show Gist options
  • Save MoralCode/1c3affe1f7c286531eb40f19ccd02b8b to your computer and use it in GitHub Desktop.
Save MoralCode/1c3affe1f7c286531eb40f19ccd02b8b to your computer and use it in GitHub Desktop.
A short bash script that non-recursively moves the current directory (which must contain all image files) based on their width.
rejectdir="../reject/lowres"
for filename in *
do
width=`identify -format "%w" $filename`
if [ $width -ne 2000 ]
then
mv "$filename" "$rejectdir"
echo "moved $width px wide file $filename"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment