Tuesday, November 25, 2008

Finding and deleting folders from filesystem. Like .svn folders from svn working directory

The following command will find all svn folders from within your current working directory and delete them all. In short this will make working directory as exported project.
find . -name .svn -exec rm -rf {} \;
Explanation:
The find command will start searching from '.'(Current directory)
Will find the file/folder whose name is '.svn'
The -exec will execute 'rm -rf' command on the result of find command. i.e. the {} will return all files/folders returned by find command.
And the last '\' is important it is escape character.
So you are done....
Be aware you are using rm -rf command..
(I have tested it on Ubuntu 6.06)

1 comment:

Prashant k said...

This is nice post dude..
I always facing this problem... You gave me solution ... thanx. !