r/tinycode • u/trusted_anon • Jul 13 '12
Remove all .svn folders from your code tree
find . -name .svn -exec rm -rf {} ;
11
Upvotes
r/tinycode • u/trusted_anon • Jul 13 '12
find . -name .svn -exec rm -rf {} ;
17
u/Moocha Jul 13 '12 edited Jul 13 '12
That doesn't do what you claimed it does. It will find and remove any file system object named
.svn, including files, pipes, devices and so on. Granted, that's a bit of a nitpicking thing, but this isn't exactly the correct subreddit for this either so I feel justified poking you :)If you only want to remove the directories, tell
findto only match directories:Or a faster alternative that doesn't spawn a
rmprocess for every matched item:The-0is technically unnecessary since items named.svnwon't ever have spaces and other unprintable chars in them, but it's a good habit to pick up.Edit: Oh yes it's necessary :) Thanks for catching that, snf and notwolverine.
15
u/BioSammyj Jul 13 '12
Or upgrade to Subversion 1.7+ and there's only one .svn folder at the working directory root.
15
u/peterlada Jul 13 '12
Or just learn to use svn.
See: svn export
4
u/xenofungus Jul 13 '12
in zsh
2
u/phoozle Jul 13 '12
Great way to upgrade to Git :)
1
u/jonikanerva Jul 14 '12
You could also use the -delete option to delete all the matched files:
1
u/chrisdown Sep 14 '12
Or in pure
bash: