From owner-freebsd-questions Fri May 12 22:26:43 2000 Delivered-To: freebsd-questions@freebsd.org Received: from blues.jpj.net (blues.jpj.net [204.97.17.146]) by hub.freebsd.org (Postfix) with ESMTP id C67CD37BBB4 for ; Fri, 12 May 2000 22:26:39 -0700 (PDT) (envelope-from trevor@jpj.net) Received: from localhost (trevor@localhost) by blues.jpj.net (right/backatcha) with ESMTP id e4D5QaA23463; Sat, 13 May 2000 01:26:36 -0400 (EDT) Date: Sat, 13 May 2000 01:26:36 -0400 (EDT) From: Trevor Johnson To: Darren Wyn Rees Cc: freebsd-questions@FreeBSD.ORG Subject: Re: "rm -rf *" - "argument list too long" In-Reply-To: <20000507201410.M540@netlink.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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 ? This will recursively remove just the plain files, leaving behind directories, symlinks, pipes, and device files: find -type f -exec rm \{\} \; With your shell, you might not have to use as many escapes. -- Trevor Johnson http://jpj.net/~trevor/gpgkey.txt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message