LMSouq
general-dev Open

How to count number of files in each directory?

US
user784637
1 month ago
3 views
Problem Description
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?

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base