Few days ago, i’m looking for way to delete all the .svn folder. Today i found the way to delete all .svn folder from my project folder in Linux.
To delete all .svn folder in Linux just follow the steps below:-
Advertisements
- Start Terminal
- change your current directory to your project folder (ex: /Users/me/Sites/project_a)
- enter this command
find ./ -name ".svn" | xargs rm -Rf
- Done, all your .svn folder has been deleted.
By the way, you also can apply this method to remove all .svn folder in Mac machine.
Related posts:
How to split large file into several smaller files - Linux
How to disable dashboard in Mac OS X
Adjust your Mac fan speed with smcFanControl
How to switch window within the same program in Mac OS X
Free SVN Client (GUI) for Mac OS X - SvnX
How to convert flac to mp3 file in Mac OS X
CPAN Error: make test had returned bad status, won't install without force
Free image editor for Mac OS X / XP / Vista / Linux
Share this with your friends:-
Hi Roy, u need to make sure you are at your project folder.
eg. if the svn folder is in /Users/abc/Sites/myproject/.svn
then you have to cd /Users/abc/Sites/myproject/
then use the command at my post to remove all the .svn folder
Am using mac. I used this command. The .svn files stand as it is. and now my Applications directory is not visible in the bash terminal. Any help?
Worked like a charm on OS X – Thank you!
Another way:
find . -iname “*.svn” -exec rm -rf {} ;
=)
InFog
This works for directories that have spaces in the name:
find ./ -name “.svn” | sed ‘s/ /\\ /g’ | xargs rm -Rf
what the fck!!! all my .svn files deleted. i was on the folder in my desktop. then i did this command. but all .svn files in my system have been deleted.
This was very bad thing!!! nevr do this to anyone. if u not sure about the commond dont give!!
This works nicely unless your have spaces in your search path 🙂
It is much better to use xargs with 0 as devider between found directories.
The command will then look like this:
find . -type d -name .svn -print0 | xargs -0 /bin/rm -rf
A client asked me to remove all .svn info in a project for security reasons and I thought I’d have to do a new version or something, but this solved all of my problems. THANK YOU!
@Eranga, that won’t work for large amounts of files. @Merwok’s example does.
Thx a lot, works perfectly on OSX 10.6 Leopard !
Thanks for the post. It helped me alot.
Why -iname? These directories are always lower-case. Moreover, specifying “-type d†will ensure find returns only directories, not regular files. We could also make sure directories with spaces won’t cause the command to break. So:
find -type d -name .svn -print0 | xargs -0 rm -rf
I prefer this:
rm -rf `find -iname .svn`
Thanks. It works for me in linux. ubuntu 8.04 but nautils-svn cache still show the svn icon overlay but there was no .svn folders.
Thanks again.
This did no work for me on OSx.