From owner-freebsd-questions Tue Sep 10 11:40:59 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B926637B400 for ; Tue, 10 Sep 2002 11:40:55 -0700 (PDT) Received: from jazz.ar.yahoo.com (jazz.ar.yahoo.com [200.59.150.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 405D343E42 for ; Tue, 10 Sep 2002 11:40:54 -0700 (PDT) (envelope-from adrianm@jazz.ar.yahoo.com) Received: from jazz.ar.yahoo.com (localhost.yahoo.com [127.0.0.1]) by jazz.ar.yahoo.com (8.12.3/8.12.3) with ESMTP id g8AIer6B003181; Tue, 10 Sep 2002 15:40:54 -0300 (ART) (envelope-from adrianm@jazz.ar.yahoo.com) Received: (from adrianm@localhost) by jazz.ar.yahoo.com (8.12.3/8.12.3/Submit) id g8AIepQ1003180; Tue, 10 Sep 2002 15:40:51 -0300 (ART) (envelope-from adrianm) Date: Tue, 10 Sep 2002 15:40:51 -0300 From: Adrian Mugnolo To: Derek Cc: Jean-Yves Lefort , questions@FreeBSD.ORG Subject: Re: Directory containing many files Message-ID: <20020910154051.A2974@jazz.ar.yahoo.com> References: <20020910132907.1aabde58.jylefort@brutele.be> <018401c258e0$c2165fc0$04fea8c0@motorcity.on.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <018401c258e0$c2165fc0$04fea8c0@motorcity.on.ca>; from derek@durham.net on Tue, Sep 10, 2002 at 11:43:06AM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, > > Can some problems arise by having that many files in one > > single directory? > > I have had issues with (bash) shell globbing. For example the > command: > > rm * > > may return: > argument list too long Please note that shell patterns get expanded at the command line level, not the command themselves [everybody knows that -- but takes quite a while to figure out]. For big lists you can use xargs(1): ls -1 | xargs rm Or find(1): find . -type f -maxdepth 1 -exec rm {} \; find . -type f -maxdepth 1 -delete [Not using some primaries with find(1) can produce unwanted results -- it's recursive unless told otherwise.] This comes specially handy for makefiles and scripting. HTH Regards To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message