home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / question / 13040 < prev    next >
Encoding:
Text File  |  1992-11-07  |  2.3 KB  |  51 lines

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