Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know is there any limit on subfolders within folder in Linux and windows?

can any one provide information on how many subfolders can be created in one folder?

Thanks in advance for any input.

share|improve this question
Usually if you have to ask this question, you've designed something wrong. That's just my experience though. Care to share the reason why you're asking? – William Brendel Jun 1 '09 at 12:55

If you are using ext3 in Linux, the limit is explained by Wikipedia:

There is a limit of 31998 sub-directories per one directory, stemming from its limit of 32000 links per inode.

share|improve this answer

For FAT16 filesystems (mostly irrelevant these days, but still default on some USB mass storage / memory card devices) there is a limit of 512 directory entries in the root directory.

This can be less than 512 files/folders when long filenames are used.

Sub-folders do not have this problem.

share|improve this answer

The number of possible directories/sub folders is limited by the number of inodes for the file system. In ext3, for example, it is typically V/2 where V is the volume size bytes. So there is no limit in how many nested levels you can go for folders.

However, the maximum number of sub directories in one directory, for ext3, is limited to around 32000.

share|improve this answer
Note however that in order to access the files you need to provide a path < PATH_MAX which in Linux is usually set at 4096. So if your path is over 4k in length you might experience some failures – njsf Jun 1 '09 at 13:01

These theoretical limits are all well and good but in reality you will see serious performance problems with too many folders or files in a single folder under fat, ntfs or ext3 anyway. You wouldn't really want more than about 10,000 in any single folder.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.