Recursively delete .svn folders in UNIX
Posted by admin on February 6th, 2008 filed in LinuxThis is a simple example of a unix command, which recursively deletes subversion .svn folders. Subversion is a well-spread open-source revision control application. Every copy of source code received from subversion repository has .svn folders, which store metadata. However, if you want to use or distribute source code, these .svn folder are often not necessary.
We use find command to find all .svn folders beginning from current directory.
$ find . -type d -name .svn
./.svn
./sourceA/.svn
./sourceB/.svn
./sourceB/module/.svn
./sourceC/.svn
It is possible to pass these directories directly to rm command, using grave accent quotes (key to left of ’1′)
$ rm -rf `find . -type d -name .svn`
Leave a Comment