Deleting .svn folders recursively on OS X and Linux
Here is a handy tidbit that I came across while I was switching some of my projects from SVN to Git.
find ./ -name .svn -exec rm -rf '{}' ';'
While in the project's root folder, when you run this it will delete any .svn folders that it finds in the project folder and any of its subfolders. This made removing the SVN version control quite simple without having to run an SVN export on every project and make copies of all of them.
Mostly I am blogging this so that I have it for my own reference, but I thought others might find it useful too.
I am no expert on bash command line scripts, so I won't pretend to understand exactly what is going on here, but it seems obvious that this script will do a find on the current folder and its subfolders for any folder/file named '.svn' and run 'rm -rf' on if. The -rf attributes tell the rm command to recursively force-delete any folders and its children. This is needed since .svn matches we'll be finding are directories.
Be careful when running this, it will NOT ask you if you are sure. Of course, this will work with other files and folders as well. Like if you want to delete all of those .DS_Store files that OS X likes to stick everywhere.
find ./ -name .DS_Store -exec rm '{}' ';'
Since .DS_Store files are not directories, the -rf options are not needed.


