在Mac中计算目录及其子目录的特定文件类型的数量 [英] Count number of specific file type of a directory and its sub dir in mac
本文介绍了在Mac中计算目录及其子目录的特定文件类型的数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用ls -l *.filetype | wc -l
,但是它只能在当前目录中找到文件.
如何在子目录中计算所有具有特定扩展名的文件?
非常感谢您.
I use ls -l *.filetype | wc -l
but it can only find files in current directory.
How can I also count all files with specific extension in its sub dirs?
Thank you very much.
推荐答案
您可以使用find
命令来做到这一点:
You can do that with find
command:
find . -name "*.filetype" | wc -l
这篇关于在Mac中计算目录及其子目录的特定文件类型的数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文