How to count number of files in each directory?

前端 未结 17 2727
小蘑菇
小蘑菇 2020-12-07 07:05

I am able to list all the directories by

find ./ -type d

I attempted to list the contents of each directory and count the number of files i

17条回答
  •  温柔的废话
    2020-12-07 08:10

    THis could be another way to browse through the directory structures and provide depth results.

    find . -type d  | awk '{print "echo -n \""$0"  \";ls -l "$0" | grep -v total | wc -l" }' | sh 
    

提交回复
热议问题