From owner-freebsd-questions Thu Oct 23 17:57:44 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA10061 for questions-outgoing; Thu, 23 Oct 1997 17:57:44 -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 RAA10052 for ; Thu, 23 Oct 1997 17:57:40 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.7/8.8.5) id KAA03827; Fri, 24 Oct 1997 10:26:40 +0930 (CST) Message-ID: <19971024102640.31032@lemis.com> Date: Fri, 24 Oct 1997 10:26:40 +0930 From: Greg Lehey To: Palle Girgensohn Cc: "Matthew D. Fuller" , Shawn Ramsey , questions@FreeBSD.ORG Subject: Re: deleted huge directory References: <344F4D1C.802DE3FC@partitur.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.84e In-Reply-To: <344F4D1C.802DE3FC@partitur.se>; from Palle Girgensohn on Thu, Oct 23, 1997 at 03:11:56PM +0200 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 03:11:56PM +0200, Palle Girgensohn wrote: > Matthew D. Fuller wrote: >> >> On Wed, 22 Oct 1997, 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.) >> >> Dear god. >> If you don't mind, I'll just borrow all that space..... >> Can you get a file listing by echo * > /place/some/file.list ? >> >> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* >>> FreeBSD; the way computers were meant to be | >> * "The only reason I'm burning my candle at both ends, is * >>> that I haven't figured out how to light the middle yet."| >> * fullermd@futuresouth.com :-} MAtthew Fuller * >>> http://keystone.westminster.edu/~fullermd | >> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > > > maybe > > find dirpath -exec rm {} \; > > will do it? just a wild guess... It would work, but it spawns an rm process for every file. This would make it *very* slow. By contrast, # find dirpath | xargs rm collects as many file names as will fit on a line (typically in the order of 5000), and passes them to a single rm process. Then it repeats for the next line full. Greg