How many files can I put in a directory?

后端 未结 21 2323
北恋
北恋 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:28

    Keep in mind that on Linux if you have a directory with too many files, the shell may not be able to expand wildcards. I have this issue with a photo album hosted on Linux. It stores all the resized images in a single directory. While the file system can handle many files, the shell can't. Example:

    -shell-3.00$ ls A*
    -shell: /bin/ls: Argument list too long
    

    or

    -shell-3.00$ chmod 644 *jpg
    -shell: /bin/chmod: Argument list too long
    

提交回复
热议问题