From owner-freebsd-questions Sun May 7 17: 2: 7 2000 Delivered-To: freebsd-questions@freebsd.org Received: from syrenna.deep-ocean.net (ca-ol-bordeaux-7-4.abo.wanadoo.fr [62.161.110.4]) by hub.freebsd.org (Postfix) with ESMTP id CF8BE37B925 for ; Sun, 7 May 2000 17:02:02 -0700 (PDT) (envelope-from olive@deep-ocean.net) Received: from pozeidon (pozeidon.deep-ocean.net [192.168.0.12]) by syrenna.deep-ocean.net (8.9.3/8.9.3) with SMTP id BAA28684; Mon, 8 May 2000 01:58:43 +0200 (CEST) (envelope-from olive@deep-ocean.net) From: "Olivier Cortes" To: "Doug Barton" , "FreeBSD Questions" Subject: RE: "rm -rf *" - "argument list too long" Date: Mon, 8 May 2000 01:59:58 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2776.0) In-Reply-To: <39160161.4BCFEFE3@gorean.org> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG yeah ! great answer ! I use to be too sophisticated. thanks to pull me back to simplicity :) Olivier PS: but don't you think a little program written in perl ou c could.... Okay, i shut up :) > -----Message d'origine----- > De : owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG]De la part de Doug Barton > Envoyé : lundi 8 mai 2000 01:51 > À : Darren Wyn Rees > Cc : freebsd-questions@freebsd.org > Objet : Re: "rm -rf *" - "argument list too long" > > > Darren Wyn Rees wrote: > > > > I'm in a directory with a tonne of files I wish to delete. > > I type "rm -rf *", but it won't work, it gives "/bin/rm: Argument > > list too long". So how can I delete these many files ? > > > > I can "cd ..", and then "rm -rf ", and that works. > > > > However, what if I didn't wish to remove directories. In that > > case, what would I do to remove the files ? > > First, ignore the overly complicated and potentially dangerous answers > so far on this thread. :) Second, think about it for a minute. If "*" > provides a list that's too long for rm to handle, why not break it up > into smaller chunks? For example, if your files mainly have alpha > characters in their names, do something like: > > rm [a-c]* > > Starting with larger chunks, and going smaller as needed till the error > messages disappear. > > Doug > -- > "Live free or die" > - State motto of my ancestral homeland, New Hampshire > > Do YOU Yahoo!? > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message