计算目录中特定文件类型的编号及其在mac中的子目录

Xit*_*rum 29 unix macos terminal

我使用ls -l *.filetype | wc -l但它只能在当前目录中找到文件.
如何计算其子目录中具有特定扩展名的所有文件?
非常感谢你.

P.P*_*.P. 59

您可以使用find命令执行此操作:

find . -name "*.filetype" | wc -l
Run Code Online (Sandbox Code Playgroud)