What's the maxium number of files a Unix folder can hold?

Varies per file system, http://en.wikipedia.org/wiki/Comparison_of_file_systems


On all current Unix filesystems a directory can hold a practically unlimited number of files. Whereas "unlimited" is limited by diskspace and inodes - whatever runs out first.

With older file system designs (ext2, UFS, HFS+) things tend to get slow if you have many files in a directory. Usually things start getting painful around 10,000 files. With newer filesystems (ReiserFS, XFS, ZFS, UFS2) you can have millions of files in a directory without seeing general performance bottlenecks.

But having so many files in a directory is not well tested and there are lots of tools which fail that. For example, periodic system maintenance scripts may barf on it.

I happily used a directory with several million files on UFS2 and had seen no problems until I wanted to delete the directory - that took several DAYS.