Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Length of argument list
- X-seq: zsh-workers 35437
- From: Manfred Lotz <manfred.lotz@xxxxxxxx>
- Subject: Re: Length of argument list
- Date: Thu, 11 Jun 2015 11:23:47 +0200
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- 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=
- In-reply-to: <CAHYJk3R4pCYWths7g=Mfd+xDBAdxetHSusCyvq6P5KFrsd4DuQ@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20150610204814.4aa2f5aa@hogwart.bsdlocal.net> <CAHYJk3R4pCYWths7g=Mfd+xDBAdxetHSusCyvq6P5KFrsd4DuQ@mail.gmail.com>
On Wed, 10 Jun 2015 22:09:06 +0200
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On Wed, Jun 10, 2015 at 8:48 PM, Manfred Lotz <manfred.lotz@xxxxxxxx>
> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author