Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
Number of files per directory

I need to save 1 milion static html files in one directory as there is not possible to group the files into the directories (all files must have path like page-name.html. Already tested with 200 000 fles and seem to be no problem on Linux, but wonder if still won't be problematic with 1 million of static pages?

share|improve this question

migrated from stackoverflow.com May 15 '11 at 14:01

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Gilles, Michael Mrozek May 16 '11 at 21:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

question, maybe you could put those files into a sql database instead? –  Johan May 16 '11 at 10:43

2 Answers 2

The number of inodes that can be created on a linux system is typically extremely massive. The exact number depends on a LOT of variables, but here's a thread on the Ubuntu forums about calculating inodes for your system and about how to show information through terminal commands.

Edit (Ubuntuforums thread now requires login):
Here's essentially what the thread says, and references Wikipedia.

It varies. First off, depending on what file system your Linux install uses. The default is ext3, but even within that filesystem, the maximum number of files varies. From Wikipedia:


The maximum number of inodes (and hence the maximum number of files and directories) is set when the file system is created. If V is the volume size in bytes, then the default number of inodes is given by V/2^13 (or the number of blocks, whichever is less), and the minimum by V/2^23. The default was deemed sufficient for most applications.

The Wikipedia quote is cited as plain text, so there's no verifiable source, so that's pretty much the end of that trail.

I think the bottom line is that unless you've filled your disk with billions of tiny files, you're probably going to run out of disk space before you run out of inodes.

share|improve this answer
Thanks a lot for useful information. –  Newbie1 May 15 '11 at 13:32

It will work. It will be slow.

share|improve this answer