> Is there a limit to the number of files you can have in 1 directory in
> I'm approaching over 50,000 files in 1 directory.
I do not know if there is a specific limit, but there is a maximum file
size of about 2 Gigabytes, and since a directory is just another file, it
cannot exceed 2 Gigabytes. In the old days, a directory entry was 16
bytes, so it would have been easy to calculate. I assume directory
entries are larger now, since filenames are no longer restricted to 14
bytes, so that limit is probably smaller now. And the largest partition
you can have is 2 Terabytes, IIRC.
Before you hit that limit, you will probably find you have run out of
i-nodes, so you cannot create any more files in your file system. Of
course, if your partition is large enough, perhaps you will not run out
Another thing to consider is managing a directory that large. An ls
command must take forever!
> .~. Jean-David Beyer Registered Linux User 85642.
> /V\ Registered Machine 73926.
> /( )\ Shrewsbury, New Jersey
> ^^-^^ 5:36pm up 26 days, 1:04, 3 users, load average: 1.05, 1.10, 0.99