TurnKey Linux Virtual Appliance Library
Eric (tssgery)'s picture

depends on the filesystem

in theory with EXT4, the default, you can have an unlimited number of subdirectories and files. The limit is on the entire filesystem. 

In reality, it is controlled by the size of the inode table. run 'df -i' to see the inode tables for your specific system. Mine shows:



Filesystem            Inodes   IUsed   IFree IUse% Mounted on


                      864960   52839  812121    7% /

tmpfs                 129302       4  129298    1% /lib/init/rw

udev                  128098     494  127604    1% /dev

tmpfs                 129302       1  129301    1% /dev/shm

/dev/sda1             124496     207  124289    1% /boot
which means I can have ~864000 files in my root filesystem.

mishav's picture

so you can theoretically have

so you can theoretically have one subdirectory with 864000 files/directories inside it on your system?

Eric (tssgery)'s picture

That is correct.

theoretically, yes. 

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)