[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How many files can be put in one directory?



> | Many shells like bash and csh won't process them
> | cleary.
> 
> What happens is that the shell tries to expand the wildcard, and that
> expansion exceeds the limit on length of a command line.  If you have
> a thousand files with only 2 characters in their name, that would
> yield a 3k command line, which I think is within the limit (but
> haven't tested).  I think that limit is a kernel one because bash
> (cygwin) on windows gets cut off MUCH earlier than bash on linux does.
> I discovered that while using  `find . <...>`  in the build process of
> a certain library.

It is a kernel limit.

On my Linux machine.

  getconf ARG_MAX
  131072

That is space for combined environment and commandline.  Dependent no
only on the size of the commandline but also on the size of the
environment too.  Check out this FAQ.

  http://www.gnu.org/software/fileutils/doc/faq/#Argument%20list%20too%20long

Bob

Attachment: pgptN8TLLiP_x.pgp
Description: PGP signature


Reply to: