A quick bash script to recursively delete everything with a specific name or extension.

There are a number of tips on the web offering simple scripts that delete the .svn files from a file tree if you’re transitioning to another versioning system, or getting rid of versioning all together. The problem with the script I found was that it doesn’t work on .svn folders within a folder whose name contains a space. So, with some help from Adam Knight’s blog, I slapped together a script that handlesspaces:

find . -name ".svn" | whilereadFILE; do rm -Rf "$FILE"; done

Works great for mass-deleting just about anything buried deep within a directory structure, such as pyc or bak files.