Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Oct 1997 10:26:40 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Palle Girgensohn <girgen@partitur.se>
Cc:        "Matthew D. Fuller" <fullermd@futuresouth.com>, Shawn Ramsey <shawn@luke.cpl.net>, questions@FreeBSD.ORG
Subject:   Re: deleted huge directory
Message-ID:  <19971024102640.31032@lemis.com>
In-Reply-To: <344F4D1C.802DE3FC@partitur.se>; from Palle Girgensohn on Thu, Oct 23, 1997 at 03:11:56PM %2B0200
References:  <Pine.BSF.3.96.971023005911.29151B-100000@shell.futuresouth.com> <344F4D1C.802DE3FC@partitur.se>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971024102640.31032>