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

Re: Max file number in single directory




On Sun, Sep 01, 2002 at 11:56:58PM +0100, Christoph Hellwig wrote:
> 
> On Sun, Sep 01, 2002 at 10:39:11PM -0000, root@larry.minfin.government.bg.sgi.com wrote:
> > I got this error when I try to proceed my directory
> > 
> > root@larry:~/phones/new_scripts# ls CHEPELARE/*.htm
> > bash: /bin/ls: Argument list too long
> > 
> > Also I'd like to know, if this is general Linux VFS, XFS or file-utils implementation restriction/bug or whatever
> 
> It's a general Linux limitation - but nothing related to the number of files
> in a directory.  By doing a ls CHEPELARE/*.htm you let the shell glob the
> filenames and pass all matching ones to /bin/ls.  With 30303 html files in
> directory these are quite a lot and the resulting array overflows the hardcoded
> change for the argument size in the kernel binary loader.

The problem can be avoided by not using shell-globbing, and rather do 
something like:
find CHEPELARE -name '*.htm' -ls


-- 
Ragnar Kjørstad