Solved

Recursively deleting a specified directory

Posted on 2002-04-30
5
243 Views
Last Modified: 2012-05-04
I have a big tree directory structure, each directory having a cvs directory inside it (except for the cvs directory itself).  I want to recursively delete just the CVS directories but leave all the others intact.  I know that I will need to use something like grep, find, rm, -R, but I can't seem to get it right.  Any ideas?  Thanks!!!!!

0
Comment
Question by:alpine
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Accepted Solution

by:
rmkandan earned 100 total points
ID: 6980539
Hi alpine,

Try using the following command to delete files

find . -name "/cvs/*.*" -print | xarg rm -r | more

bye
Mani.r.
0
 

Author Comment

by:alpine
ID: 6981278
Thank you!  Not exactly correct but your help definitely brought me to the solution:

find . -name CVS -print | xargs rm -r | more

Thank you again.  You saved me a lot of time!!!!
0
 

Author Comment

by:alpine
ID: 6981282
Thank you!  Not exactly correct but your help definitely brought me to the solution:

find . -name CVS -print | xargs rm -r | more

Thank you again.  You saved me a lot of time!!!!
0
 
LVL 21

Expert Comment

by:tfewster
ID: 7621404
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- Answered by rmkandan

Please leave any comments here before 13/1/2003

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster (I don't work here, I'm just an Expert :-)
0
 

Expert Comment

by:SpideyMod
ID: 7805286
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question