Fast Linux file count for a large number of files

后端 未结 17 2643
名媛妹妹
名媛妹妹 2020-12-22 17:21

I\'m trying to figure out the best way to find the number of files in a particular directory when there are a very large number of files (more than 100,000).

When the

17条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-22 18:07

    This answer here is faster than almost everything else on this page for very large, very nested directories:

    https://serverfault.com/a/691372/84703

    locate -r '.' | grep -c "^$PWD"

提交回复
热议问题