Remove SVN Files From Source In Linux

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.
CAPTCHA
9 + 9 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.