Tuesday, 27 January 2009

How to recursively delete a directory

I was in a situation where I wanted to remove CVS files from my source code directory. I found the following at Any Example:

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

You can try the following by itself first:

find . -type d -name CVS

You can also put this into a script:

echo "recursively removing .svn folders from"
rm -rf `find . -type d -name CVS`

No comments:

Post a Comment