home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!gatech!news.ans.net!cmcl2!psinntp!psinntp!newsserver.pixel.kodak.com!laidbak!tellab5!odgate!ssigate!msc
- From: msc@ssigate.ssinc.com (Michael S. Cross)
- Subject: Re: thousands of dirs, how to delete...
- Message-ID: <1992Nov5.135011.16991@ssigate.ssinc.com>
- Summary: two solutions
- Keywords: Regular Expressions, find
- Organization: Systems and Synchronous Inc., Naperville, IL
- References: <1992Oct26.135931.4036@wixer.cactus.org> <1992Oct27.064721.3431@wixer.cactus.org>
- Date: Thu, 5 Nov 1992 13:50:11 GMT
- Lines: 38
-
- cb@wixer.cactus.org (Cyberspace Buddha) writes:
- >>
- >>Not too long ago, there was a brief discourse on rming a shipload of
- >>files/dirs. I've since forgotten the method<s> suggested for fixing
- >>this "problem". That coupled with the fact that some goobre on this
- >>system seems to have created a huge number of directories <who knows
- >>why> and we kinda wanna get rid of them, ya know? ;)
- >
- >I knew I'd forget something. Some kind netter has already mailed
- >me suggesting "rm -rf <dirname>"...
- >what I forgot was to mention that the sysadmin here already tried
- >that and rm complained about there being too many dirs/files...
- >
-
- Well, I usally do "rm -rf <dirname/a*>" first, then maybe
- "rm -rf <dirname/[b-d]*>" if things work out fine on the first one.
-
- This happens every once in a while with files in the spool directories
- if a machine "goes away" and uucp can't deliver mail, or, the cron stops
- cleaning up the */tmp* directories. If I clean up maybe 25% of them
- "by hand", then I can issue "rm -rf <dirname/*>" without rm (or even ls)
- complaining there are too many files.
-
- Of course, you could try: "find <dirname> -depth -print | xargs rm -f"
- I can't remember if this worked in my case or not. You can also use
- the "-exec rm {} \;" argument instead of piping it through xargs(1).
- Personally, I can never remember the funny braces-slash-semicolon
- sequence at the end, so I never use this incantation.
-
- Hope it helps (tm).
-
- Mike
-
- --
- Michael S. Cross Work: msc@ssihub.ssinc.com 708-505-4508
- Home: 73750.1363@CompuServe.com (but not exactly *proud* of it)
- Systems and Synchronous Inc., 900 E. Diehl Rd, Suite 110, Naperville, IL 60563
- __________________________To Live is to risk Dying____________________________
-