Created
January 31, 2014 14:28
-
-
Save hugooliveirad/8733029 to your computer and use it in GitHub Desktop.
Find WordPress generated thumbnails and execute a command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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