deleting CVS administrative directories recursively

William O'Higgins william.ohiggins-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Fri Apr 9 16:52:20 UTC 2004


I wrote:
>>I used to use CVS, and I am migrating to subversion.  I don't have my
>>CVS respository (long story), and so the CVS directories all over the 
>>place are of little use to me.  I would like to remove them all, but I'm
>>not sure how.
>>
>>Should I do a find piped to a rm, or is there a better way?  I am
>>uncertain of the best way to do this, and I'd rather not recursively
>>deleted things I actually want, you know?  Thanks.
>> 
>>

On Fri, Apr 09, 2004 at 12:30:49PM -0400, Tom Legrady wrote:
>   find $start_here -name CVS -exec rm -rf {} \;

On Fri, Apr 09, 2004 at 09:18:35AM -0600, Taavi Burns wrote:
>You mean find piped to xargs which runs rm?
>
>find . -type d -name CVS | xargs rm -Rf
>
>You could also get find to invoke rm yourself, but this version
>with xargs would probably actually be faster, as it would fork
>one extra xargs, but fork far, far fewer copies of rm (xargs will
>fill the maximum commandline size with parameters).

Both of these work, thank you.  Tom's solution has the added
benefit(flaw?) of throwing an error for each hit, but with only a few
dozen directories there is no appreciable difference in performance.
Taavi's solution has the downside that I now have to make a note to
spend time reading man xargs, because it looks like it'd be good to
understand.
-- 

yours,

William

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list