How many files can I put in a directory?

后端 未结 21 2211
北恋
北恋 2020-11-22 05:15

Does it matter how many files I keep in a single directory? If so, how many files in a directory is too many, and what are the impacts of having too many files? (This is on

21条回答
  •  温柔的废话
    2020-11-22 05:44

    It depends a bit on the specific filesystem in use on the Linux server. Nowadays the default is ext3 with dir_index, which makes searching large directories very fast.

    So speed shouldn't be an issue, other than the one you already noted, which is that listings will take longer.

    There is a limit to the total number of files in one directory. I seem to remember it definitely working up to 32000 files.

提交回复
热议问题