Subversion LogoOk, some posts are clearly just to help me remember how to do things… this is one of them. The Subversion source control system keeps private information in .svn directories. There is one such directory for EVERY directory in your source tree. Here’s how you recursively delete ALL the .svn directories from the current directory in Linux (or Cygwin in Windows).

rm -rf `find . -type d -name .svn`

NOTE: Those are back ticks around the ‘find’ command, not apostrophes. I recommend you just run the ‘find’ command first and verify it is listing the directories you expect.

Tagged with:  

One Response to How to Recursively Delete Subversion .svn Directories

  1. Jim says:

    You can also use the -exec option for find. In that case you would use:

    find . -type d -name .svn -exec rm -rf {} \;

    While this accomplishes the same results as your command using exec can be handy in other places.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>