[Discuss] Command line question

Deryk Barker dbarker at camosun.bc.ca
Wed Jul 26 15:14:34 PDT 2006


Adam Parkin wrote:

> Quick one for the gurus: I have a directory structure that looks 
> something like:
>
> ~/temp
>     -> user1
>         -> CVS
>         -> a3
>             -> CVS
>     -> user2
>         -> CVS
>         -> a3
>             -> CVS
>
> etc, etc for about 37 different "userX" directories.  What I want to 
> do is remove all of the CVS directories from this tree so that I end 
> up with:
>
> ~/temp
>     -> user1
>         -> a3
>     -> user2
>         -> a3
>
> What's a quick way of doing this on the command line?


Doubtless the btest way of doing this is with find - but I have too look 
up the damned syntax every time I try to use it. (Basically I can 
*never* remember which ; to escape with a \....)

However, if the directory structures are no deeper than your 
illustration, this is a QnD way:

    rm -rf ~/temp/*/CVS;rm -rf ~/temp/*/*/CVS




More information about the Discuss mailing list