How to Remove CVS Directories as a Bash Command? - Linux

This is a discussion on How to Remove CVS Directories as a Bash Command? - Linux ; When I do a CVS checkout, every directory contains a subdirectory "CVS" with a few files in it (that help CVS manage the sandbox). In a Unix system, how do I recursively remove all these directories? (There may be hundreds, ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: How to Remove CVS Directories as a Bash Command?

  1. How to Remove CVS Directories as a Bash Command?

    When I do a CVS checkout, every directory contains a subdirectory "CVS" with
    a few files in it (that help CVS manage the sandbox).

    In a Unix system, how do I recursively remove all these directories? (There
    may be hundreds, so I'm looking for a way to do it automatically with a
    single command rather than manually.)

    Thanks.

    P.S.--This will not be done to an active CVS sandbox. It is before
    packaging as a tar.gz file. The CVS directories aren't harmful, but they
    aren't helpful either.



  2. Re: How to Remove CVS Directories as a Bash Command?

    On Sun, 31 Dec 2006 16:08:21 -0500, David T. Ashley wrote:

    > In a Unix system, how do I recursively remove all these directories?


    man rm would suggest a switch or two.

  3. Re: How to Remove CVS Directories as a Bash Command?

    "Bit Twister" wrote in message
    news:slrnepg9s9.pk8.BitTwister@wb.home.invalid...
    > On Sun, 31 Dec 2006 16:08:21 -0500, David T. Ashley wrote:
    >
    >> In a Unix system, how do I recursively remove all these directories?

    >
    > man rm would suggest a switch or two.


    The most obvious choice would be "rm -fR CVS", but I discovered that this
    only removes the CVS directory as part of the current working directory; it
    does not recursively go lower.

    And hence I still need help ...

    Thanks.



  4. Re: How to Remove CVS Directories as a Bash Command?

    David T. Ashley wrote:
    > When I do a CVS checkout, every directory contains a subdirectory "CVS" with
    > a few files in it (that help CVS manage the sandbox).
    >
    > In a Unix system, how do I recursively remove all these directories? (There
    > may be hundreds, so I'm looking for a way to do it automatically with a
    > single command rather than manually.)
    >
    > Thanks.
    >
    > P.S.--This will not be done to an active CVS sandbox. It is before
    > packaging as a tar.gz file. The CVS directories aren't harmful, but they
    > aren't helpful either.


    Removing the "CVS" directories is the hard way! Instead, do a "cvs export"
    rather than a "cvs checkout". The export command is meant to do exactly
    what you're trying to do -- it will get the tree of files out of the
    repository but without creating the "CVS" directories.

    - Logan

  5. Re: How to Remove CVS Directories as a Bash Command?

    "David T. Ashley" writes:

    > When I do a CVS checkout, every directory contains a subdirectory "CVS" with
    > a few files in it (that help CVS manage the sandbox).
    >
    > In a Unix system, how do I recursively remove all these directories? (There
    > may be hundreds, so I'm looking for a way to do it automatically with a
    > single command rather than manually.)
    >
    > Thanks.
    >
    > P.S.--This will not be done to an active CVS sandbox. It is before
    > packaging as a tar.gz file. The CVS directories aren't harmful, but they
    > aren't helpful either.


    1- Use cvs export instead.

    2- Use find: find . -name CVS -prune -exec rm -rf {} \;


    --
    __Pascal Bourguignon__ http://www.informatimago.com/

  6. Re: How to Remove CVS Directories as a Bash Command?

    "Bit Twister" wrote in message
    news:slrnepgalg.pk8.BitTwister@wb.home.invalid...
    > On Sun, 31 Dec 2006 16:19:08 -0500, David T. Ashley wrote:
    >>
    >> The most obvious choice would be "rm -fR CVS", but I discovered that this
    >> only removes the CVS directory as part of the current working directory;
    >> it
    >> does not recursively go lower.

    >
    >
    > Hmmm, try this and see what happens.
    >
    > $ mkdir -p aa/a1/a2/a3
    > $ ls -R aa*
    > aa:
    > a1
    >
    > aa/a1:
    > a2
    >
    > aa/a1/a2:
    > a3
    >
    > aa/a1/a2/a3:
    >
    > $ /bin/rm -r aa


    Doesn't work for my problem.

    For example, the following directories might all exist.

    CVS
    aa/CVS
    aa/bb/CVS
    aa/bb/cc/CVS
    aa/cc/dd/CVS

    The command you recommended will only get "CVS" and its children; it won't
    touch the others.

    The -r/-R switch to rm instructs it to recurse for the purposes of deletion;
    not for the purposes of finding a new match against "CVS".

    Thanks for your help.



  7. Re: How to Remove CVS Directories as a Bash Command?

    "Logan Shaw" wrote in message
    news:45982f34$0$5200$4c368faf@roadrunner.com...
    >
    > Removing the "CVS" directories is the hard way! Instead, do a "cvs
    > export"
    > rather than a "cvs checkout". The export command is meant to do exactly
    > what you're trying to do -- it will get the tree of files out of the
    > repository but without creating the "CVS" directories.


    Thanks,

    cvs export -D now gpl01

    worked great for what I was trying to do.

    I'm assuming "-D now" is adequate to get the tip of development. (I don't
    often tag or use branches, so this is all pretty easy in my case.)



  8. Re: How to Remove CVS Directories as a Bash Command?

    "Pascal Bourguignon" wrote in message
    news:877iw7loxy.fsf@thalassa.informatimago.com...
    >
    > 2- Use find: find . -name CVS -prune -exec rm -rf {} \;


    Worked great. I was secretly suspecting that my server would begin smoking,
    but ... worked as described.

    I never knew find had those options.

    Thanks.



  9. Re: How to Remove CVS Directories as a Bash Command?

    "David T. Ashley" writes:

    > P.S.--This will not be done to an active CVS sandbox. It is before
    > packaging as a tar.gz file. The CVS directories aren't harmful, but they
    > aren't helpful either.


    If you are just doing it before a tar, just give add the --exclude
    option. Something like this:
    tar --exclude=CVS -cvf - | gzip -c > .tar.gz

    --
    John L. Fjellstad
    web: http://www.fjellstad.org/ Quis custodiet ipsos custodes
    Replace YEAR with current four digit year

  10. Re: How to Remove CVS Directories as a Bash Command?

    David T. Ashley wrote:
    > P.S.--This will not be done to an active CVS sandbox. It is before
    > packaging as a tar.gz file. The CVS directories aren't harmful, but they
    > aren't helpful either.


    find . -type d -name CVS -print0 | xargs -0 rm -rf

    where . is the starting directory.


    Igmar

  11. Re: How to Remove CVS Directories as a Bash Command?

    Quote Originally Posted by unix View Post
    David T. Ashley wrote:
    > P.S.--This will not be done to an active CVS sandbox. It is before
    > packaging as a tar.gz file. The CVS directories aren't harmful, but they
    > aren't helpful either.


    find . -type d -name CVS -print0 | xargs -0 rm -rf

    where . is the starting directory.


    Igmar
    Thanks a ton..!
    works on windows too (using cygwin)

+ Reply to Thread