1

How to count number of files in each directory?

view story
linux-howto

http://stackoverflow.com – 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 in each directory by using the following command find ./ -type d | xargs ls -l | wc -l But this summed the total number of lines returned by find ./ -type d | xargs ls -l Is there a way I can count the number of files in each directory? (HowTos)