Deleting files recursively

The rm command deletes files. To delete a directory which is not empty and its subdirectories, use

$ rm -rf directory

However, sometimes you would need to remove specific subdirectory rather than the entire directory and its contents. For example

|-- engine
|-- mod
     |-- .svn
     |-- anytext
     |    |-- .svn
     |    |-- actions
     |-- crontrigger
     |    |-- .svn
     |    |-- views

We want to delete all .svn directories and nothing else. We could manually do rm-r .svn for every .svn directory but there is an easier and more elegant way:

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

find will find all directories name .svn and rm would delete them and their contents.