Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 directory that I want to delete all the .svn folders in all of its subdirectories. Is there a command that can do this without me having to go through each individual subdirectory and delete them that way? I tried doing it through nautilus as suggested here How to delete all the files with a certain extension from a folder and all of its subfolders?

But when I search, it does not show any hidden folders, even though I have that option enabled.

Any help is appreciated.

share|improve this question
up vote 2 down vote accepted

Find all such directories:

find -name .svn -type d

If you are sure, delete all of them:

find -name .svn -type d -delete
share|improve this answer
Sorry for the edit. It's my bad - have forgotten '.svn' is the exact name. Can't find a way to cancel it - please ignore. – Pavel A Dec 11 '12 at 20:32
Actually the rm -rf blah blah command can lead to errors if there's a space in the file name/path. It's better if you do: find -name .svn -type d -delete. – Eric Carvalho Dec 11 '12 at 21:20
@EricCarvalho is right, updated. – jasxun Dec 11 '12 at 21:25

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.