Remove SVN Files From Source In Linux

26th June 2012 - 1 minute read time

There might be a couple of reasons why you would want to do this. Perhaps the repository has been checked out instead of exported, or maybe the repository doesn't exist any more. A couple of strategies exist remove all SVN files from a set of directories in Linux. You can either use the rm command directly and pass in a find command using grave accent quotes (key to left of '1').

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

Or you can pass the output of the find command to the xargs command, which calls the rm command.

find . -type d -iname ".svn" -print0 | xargs -0 rm -rf

You can even use the -exec flag of the find command to run the rm command.

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

Add new comment

The content of this field is kept private and will not be shown publicly.