Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Java project and it used a SVN repository, now I decide to change to GIT.

However the problem is that SVN engine that I used created in every folder of the project the .svn metadata directory.

I want to clean all folders of the project of this hidden folder.

Is there any terminal command to search in folder and clean it ?

share|improve this question
up vote 19 down vote accepted

You will have to move to desire folder using cd command then write following command:

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

This will remove the all svn files from current and sub-directories.

share|improve this answer

Another way of doing the same is:

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

share|improve this answer
I wish Windows (I have has this same issue on that platform) had solutions that were this clean and easy :( – Steven Apr 19 '11 at 12:30
There may be some script in Powershell, but I don't use Windows anymore ;-) – Chakra Apr 19 '11 at 12:35
This fails for directories with spaces in the name – enzotib Apr 19 '11 at 21:07

If it's still connected to svn just do svn export and it will copy the project with no svn metadata:)

share|improve this answer

For Windows :

  • either use UnxUtils with the previous answers
  • or use the search (F3) in explorer with ".svn" as the file name, it also worked for me
share|improve this answer

I have fond a solution by typing:

find ./ -name ".svn" | xargs rm -Rf
share|improve this answer
This is dangerous, when some dir can contain spaces in his name – enzotib Apr 19 '11 at 21:09
Yes. Beware of spaces! – hexafraction Aug 16 '12 at 23:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.