What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

UpGuard checks and validates configurations for every major OS, network device, and cloud provider.

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags



Recursively remove .svn directories

Terminal - Recursively remove .svn directories
find . -type d -name .svn -delete
2010-03-01 18:48:31
User: jmcantrell
Functions: find
Recursively remove .svn directories


There is 1 alternative - vote for the best!

Terminal - Alternatives
find . -name .svn -exec rm -r {} +;
find . -iname ".svn" | xargs rm -r $1
find -type d -name ".svn" -print0 | xargs -0 rm -rf
2010-02-25 10:16:18
User: tuxilicious
Functions: find rm xargs

man find: If no paths are given, the current directory is used. - Can anybody tell me why so many people are typing the dot?

rm -rf `find . -name .svn`
2010-02-23 08:35:06
User: jfcalvo
Functions: rm

Recursively remove .svn directories from the current location.

ls -RAx | grep "svn:$" | sed -e "s/svn:/svn/" | xargs rm -fr

Know a better way?

If you can do better, submit your command here.

What others think

It took 6 times to get this simple command right? And i hate to break it to you, but you should be using "svn export" anyway, especially since you're likely to have your working copy in some special location for working copies only

Comment by rkulla 420 weeks and 4 days ago

No idea what gt3 is trying to say, but... Downvoting this because it does not work. The -delete option won't remove nonempty directories, at least on my system. and .svn directories will always be nonempty. You could try to contort find to your will, but -prune won't work with -delete. You have to do something like the solution by nishan_n (#4917).

Comment by bwoodacre 420 weeks and 4 days ago

bwoodacre, if you click the title of the cmomand 'Recursively remove .svn directories' there's 5 previous attempts by other people to do this command on commandlinefu.com. That's what I meant by "it took 6 times".

However, you're correct, this command is wrong and will report "Directory not empty". I should have said that nishan_n had it closer but i still think people should just use 'svn export' if they want to get rid of the .svn directories safely.

Comment by rkulla 420 weeks and 3 days ago

You are right, the suggestion to use svn export is easier and less error-prone if you just want a .svn-free version of a particular chunk of a *repository*. But that doesn't handle any differences that your working copy has: unversioned files that you want to keep around, or checked-in files with changes that you don't want committed.

Comment by bwoodacre 420 weeks and 3 days ago

Your point of view

You must be signed in to comment.