From owner-freebsd-questions@FreeBSD.ORG Tue Jul 6 14:26:21 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B8E6816A4CE for ; Tue, 6 Jul 2004 14:26:21 +0000 (GMT) Received: from mynah.mail.pas.earthlink.net (mynah.mail.pas.earthlink.net [207.217.120.228]) by mx1.FreeBSD.org (Postfix) with ESMTP id A45CE43D1F for ; Tue, 6 Jul 2004 14:26:21 +0000 (GMT) (envelope-from algould@datawok.com) Received: from 20-74.lctv-b4.cablelynx.com ([24.204.20.74] helo=[192.168.63.10]) by mynah.mail.pas.earthlink.net with asmtp (TLSv1:RC4-MD5:128) (Exim 4.34) id 1Bhqtp-0008QK-HE for freebsd-questions@freebsd.org; Tue, 06 Jul 2004 07:26:21 -0700 From: "Andrew L. Gould" To: freebsd-questions@freebsd.org Date: Tue, 6 Jul 2004 09:27:29 -0500 User-Agent: KMail/1.6.2 References: <3703.209.167.16.15.1089123354.squirrel@209.167.16.15> In-Reply-To: <3703.209.167.16.15.1089123354.squirrel@209.167.16.15> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407060927.29771.algould@datawok.com> X-ELNK-Trace: ee791d459e3d6817d780f4a490ca69564776905774d2ac4b891fcf7bfdbc44418027cdb5e2810e64350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 24.204.20.74 Subject: Re: Removing thousands of files using rm X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2004 14:26:21 -0000 On Tuesday 06 July 2004 09:15 am, Steve Bertrand wrote: > I often have the need to remove hundreds or even thousands of files > from a single directory (very often). Using rm, I usually get: > > pearl# rm -rvf * > /bin/rm: Argument list too long. > > Is there any way to work around this instead of having to select a > small bunch of files at a time to remove? > > The directory I am trying to remove the files from is always hot, so > deleting the directory is unfortunately not an option. (I don't > think). > > Any assistance is greatly appreciated. > > Tks all, > > Steve You could always write a short script that reads and loops through the directory contents; and deletes one file (or a group of files) at a time. It would take a little longer, but at least it would be automated. Andrew Gould