From owner-freebsd-questions Sun May 7 17:12:45 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail.hiwaay.net (fly.HiWAAY.net [208.147.154.56]) by hub.freebsd.org (Postfix) with ESMTP id 8E13437BB14 for ; Sun, 7 May 2000 17:12:39 -0700 (PDT) (envelope-from sprice@hiwaay.net) Received: from localhost (sprice@localhost) by mail.hiwaay.net (8.10.1/8.10.1) with ESMTP id e480CUN09320; Sun, 7 May 2000 19:12:30 -0500 (CDT) Date: Sun, 7 May 2000 19:12:30 -0500 (CDT) From: Steve Price To: Doug Barton Cc: Darren Wyn Rees , freebsd-questions@FreeBSD.ORG Subject: Re: "rm -rf *" - "argument list too long" In-Reply-To: <39160161.4BCFEFE3@gorean.org> 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 On Sun, 7 May 2000, Doug Barton wrote: # 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. Something like this doesn't work? ls * | xargs rm Seems simple enough and should do it all in one pass. :) -steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message