Created
July 17, 2012 12:20
-
-
Save pauloelias/3129127 to your computer and use it in GitHub Desktop.
Bulk rename/delete
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
# Review the offending files. | |
find /path/to/files -name '*:*' -print | |
# Delete the offending files. | |
find /path/to/files -name '*:*' -exec rm {} + | |
# Rename the offending files with an underscore. | |
find /path/to/files -name '*:*' -exec rename ':' '_' {} + | |
# For a more efficient version of delete some UNIX variants support (this avoids the need to fork and exec /bin/rm for every single matching file). | |
# This -delete option is present on MacOS X and on my FC11 system (with findutils-4.4.0). | |
find /path/to/files -name '*:*' -delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment