How to count all files inside a folder, its subfol

2020-02-17 06:17发布

How to count all files inside a folder, its subfolder and all . The count should not include folder count.

I want to do it in MAC

2条回答
做个烂人
2楼-- · 2020-02-17 06:29

Find all files under myfolder and count them using wc. This works on linux:

find myfolder -type f | wc -l

查看更多
手持菜刀,她持情操
3楼-- · 2020-02-17 06:38

find . -type f | wc -l will recursively list all the files (-type f restricts to only files) in the current directory (replace . with your path). The output of this is piped into wc -l which will count the number of lines.

查看更多
登录 后发表回答