Thursday, May 13, 2010

Recursively remove folders

To remove a set of directories with the same name recursively is quite simple under unix/linux

Finding the directories to delete in this example .svn directories the following command can be used: "find . -type d -name .svn"

This command says "find from within (.) the current directory files of type (d [directories]) with the name .svn. This is done recursively.

Combining this command with an rm -rf will achieve the desired result.

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

No comments:

Post a Comment