From owner-freebsd-questions Thu Oct 23 01:50:13 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id BAA11293 for questions-outgoing; Thu, 23 Oct 1997 01:50:13 -0700 (PDT) (envelope-from owner-freebsd-questions) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id BAA11280 for ; Thu, 23 Oct 1997 01:50:08 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.7/8.8.5) id SAA00379; Thu, 23 Oct 1997 18:19:51 +0930 (CST) Message-ID: <19971023181950.01356@lemis.com> Date: Thu, 23 Oct 1997 18:19:50 +0930 From: Greg Lehey To: Gordon Henderson Cc: Shawn Ramsey , questions@FreeBSD.ORG Subject: Re: deleted huge directory References: <19971023155733.51272@lemis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84e In-Reply-To: ; from Gordon Henderson on Thu, Oct 23, 1997 at 09:39:55AM +0100 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Fight-Spam-Now: http://www.cauce.org Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Thu, Oct 23, 1997 at 09:39:55AM +0100, Gordon Henderson wrote: > On Thu, 23 Oct 1997, Greg Lehey wrote: > >> On Wed, Oct 22, 1997 at 09:38:52PM -0700, Shawn Ramsey wrote: >>> Does anyone have any suggestions for deleting a huge directory? The >>> direcory is /var/news/spool/control/cancel. The directory is too large to >>> even do a ls. If I try doing ls, it eats up all the avail. RAM(140+mb) and >>> hangs. Anyone? I would try a wildcard, but I don't know what the filenames >>> are. (This is a very large news server, and this directory has never been >>> touch as far as I know.) >> >> Doesn't rm -rf work? Otherwise you could try >> >> find dir | xargs rm -rf > > I do the following to clear this from time to time > > cd /var/news/spool/control > mv cancel cancel.old > > (then a new one gets created and news keeps on going) > > cd cancel.old > ls -f > /var/tmp/cancel.rm > xargs rm -f < /var/tmp/cancel.rm This is unnecessarily complicated. Together, they're approximately the same as what I suggested above. You certainly don't need to store the output of ls in a file. > -- > This Gordon Henderson \ MIME mail? No thanks. > is gordon@drogon.net \ "Learn the words!" > and yes, Drogon *is* an anagram of Gordon! \ The Patrician; Ankh-Morpork. Careful there, your complete name is a treasure trove of anagrams :-) Greg