Recursively delete files and folder like .svn or .DS_Store

The following command would recursively delete files and/or directories on your *nix (+OSX) system

find . -type f -name .DS_Store -exec rm -rf {} \;

Since .DS_Store is a file I have used “f” flag in the find command.

If you need to delete directories then use the “d” flag like

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

Leave a comment