From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4729 invoked by alias); 11 Jun 2015 09:58:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35437 Received: (qmail 6075 invoked from network); 11 Jun 2015 09:58:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MISSING_HEADERS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=no autolearn_force=no version=3.4.0 X-Greylist: Passed host: 79.255.25.151 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-14.arcor-online.net 3m6frN4J5Zz4nSs DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1434014628; bh=QL+BOj7RR/6XT6zWirUYdZ8DxgqOhDa8OJTRqLkQsmA=; h=Date:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding; b=n4gdkebgFxC93RNnVsUiweY0H2xat0CoUjnNbkFcsOvGKFyytnKlOV3P25wND/3RE k0fLSjF3mFV2JEoVa04zujfwonDxFGt7QgDLf25RS7tylZWawrkSFSB5++qF7NPOP5 omJlsZoqf/DEZlngUmC+2U72bTHV25PkZhKHMgfw= Date: Thu, 11 Jun 2015 11:23:47 +0200 From: Manfred Lotz Cc: "zsh-workers@zsh.org" Subject: Re: Length of argument list Message-ID: <20150611112347.70a70d7b@hogwart.bsdlocal.net> In-Reply-To: References: <20150610204814.4aa2f5aa@hogwart.bsdlocal.net> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 10 Jun 2015 22:09:06 +0200 Mikael Magnusson wrote: > On Wed, Jun 10, 2015 at 8:48 PM, Manfred Lotz > wrote: > > Hi all, > > I created 1 million files in a directory callend manyfiles/. > > > > Now > > ls manyfiles/* |wc -l > > > > gives > > zsh: argument list too long: ls > > > > > > Question: Is there a way to change the maximum size of the argument > > list? > > That depends on your operating system, on linux it is guided by ulimit > -s (in particular, the argument list is a quarter of the stack size). Interesting. Didn't know. This works indeed. Do you know how it is in FreeBSD, for instance? > On other operating systems, the limit is traditionally quite small. > I'm assuming the above is just an example, but that particular thing Yes, just an example. I want to see if it possible to use simple command when dealing with directories containing many files. > would be better handled by () { echo $# } manyfiles/*, or some > xargs/zargs contraption if you want to be more general. > ..and for f in *... and things like this. In the end it means if a directory contains a large number of files then the usual commands rm, cp, mv etc cannot be used easily without additional support (find,xargs, for loops etc). -- Manfred