Skip to content

Instantly share code, notes, and snippets.

@pauloelias
Created July 17, 2012 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauloelias/3129127 to your computer and use it in GitHub Desktop.
Save pauloelias/3129127 to your computer and use it in GitHub Desktop.
Bulk rename/delete
# 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