Skip to content

Instantly share code, notes, and snippets.

@hugooliveirad
Created January 31, 2014 14:28
Show Gist options
  • Save hugooliveirad/8733029 to your computer and use it in GitHub Desktop.
Save hugooliveirad/8733029 to your computer and use it in GitHub Desktop.
Find WordPress generated thumbnails and execute a command
# Becareful! This is not tested with every kind of names and isn't ok to use in production.
# So, never execute rm in these files. Please. Or the world will end.
#
# Be sure to run this command in wp-content/uploads.
# Please comment if any strange behavior.
# creates backup folder
mkdir -p ~/bkp
# finds thumbs and move then to ~/bkp. You can run any command after the -exec flag.
# {} is the path relative to where find was executed.
find . -iregex ".*/.*\-[0-9].*x[0-9].*\.jpg" -exec mv {} ~/bkp \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment