From owner-freebsd-questions Sun May 7 15: 0:24 2000 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id D0B6B37BD57 for ; Sun, 7 May 2000 15:00:16 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.12 #1) id 12oXwh-000LnJ-00; Sun, 07 May 2000 21:46:35 +0100 Received: (from ben) by strontium.scientia.demon.co.uk (Exim 3.12 #7) id 12oXwh-000CLV-00; Sun, 07 May 2000 21:46:35 +0100 Date: Sun, 7 May 2000 21:46:35 +0100 From: Ben Smithurst To: Darren Wyn Rees Cc: freebsd-questions@freebsd.org Subject: Re: "rm -rf *" - "argument list too long" Message-ID: <20000507214635.A79359@strontium.scientia.demon.co.uk> References: <20000507201410.M540@netlink.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000507201410.M540@netlink.co.uk> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 ? find . -delete > 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 ? find . -type f -delete Replace "-delete" with "-print | xargs rm -f" for a more portable version, with only a small amount of extra overhead. > 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.) uh.... If you can really do that with Linux, that's severely weird. It's just common sense as far as I can see to have the options first, I guess it's because that's what I'm used to. -- Ben Smithurst / ben@scientia.demon.co.uk / PGP: 0x99392F7D To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message