Limit on the number of files in UNIX

filesystemsunix

Is there a limit on the number of files in UNIX in the filesystem?

Best Answer

It depends on the type of file system. If you're using ext4 with default parameters, then you can have a maximum of:

  • 4 billion files total.
  • 64000 subdirectories in a single directory.
  • Maximum of 16TB for a single file.

Some of these are configurable and are obviously limited by actual storage space on your medium. Best to read the documentation for your filesystem type.

If you're talking about the number of file handles a process can have open at once then it depends on your system. ulimit -a will tell you on a Linux system and is likely to default to 1024.

Note: numbers were taken from the ext4 wikipedia page.