Fast Linux file count for a large number of files

后端 未结 17 2651
名媛妹妹
名媛妹妹 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 17:48

    I prefer the following command to keep track of the changes in the number of files in a directory.

    watch -d -n 0.01 'ls | wc -l'
    

    The command will keeps a window open to keep track of the number of files that are in the directory with a refresh rate of 0.1 seconds.

提交回复
热议问题