Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.