From owner-freebsd-questions Sun May 7 13:33:10 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 2834137BB5E for ; Sun, 7 May 2000 13:33:05 -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 WAA27767 for ; Sun, 7 May 2000 22:31:49 +0200 (CEST) (envelope-from olive@deep-ocean.net) From: "Olivier Cortes" To: "FreeBSD Questions" Subject: RE: "rm -rf *" - "argument list too long" Date: Sun, 7 May 2000 22:33:06 +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: <20000507201410.M540@netlink.co.uk> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG for FILE in `ls -1 DIR/` do rm "$FILE" done shell script. it doesn't work if files have spaces in their names. have fun :) Olivier > -----Message d'origine----- > De : owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG]De la part de Darren Wyn > Rees > Envoyé : dimanche 7 mai 2000 22:14 > À : freebsd-questions@freebsd.org > Objet : "rm -rf *" - "argument list too long" > > > 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 ? > > Thanks > > darren > > PS. (I'm finding it takes some getting used to putting > the operands to many commands immediately after the command. > Why is this so with FreeBSD? With Linux I can type 'rm * -rf' etc.) > > > > 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