Delete .svn directories in Linux

If you are using svn in Linux + Eclipse, you might encounter this problem. There will be lot of hidden .svn directories created in each folder. This should be cleaned if you’re going to commit this as a separate project.

Enter this command in the home directory of the project

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

Or create a bash script as follows and save this as /usr/bin/csvn

echo "recursively removing .svn folders from"
rm -rf `find . -type d -name .svn`

Now calling csvn command in any project directory will recursively delete the .svn directories under that.

Remember you’ll have to modify file permissions – for the script to become executable.

Leave a Reply