Delete Directory recursively in windows, linux

Wednesday, September 26, 2012

I have seen that many people may encounter the situation to delete the CVS or SVN directory recursively when they want to move their project to another version controlling system. Below i have given script to do this in both linux and windows.

Windows: Just run the below scipt from command prompt. This script deletes specified folder recursively even though it is in folder which contains space in name.

FOR /F "tokens=*" %G IN ('DIR /B /AD /S *CVS*') DO RMDIR /S /Q "%G"

Linux: Just run the below scipt from bash.

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