How to find the number of files in each directories on Linux?
Posted on In QAHow to find the number of files in each sub-directories of a directory on Linux?
For example,
.
├── a19
├── a8
├── d2
├── ecfddd
└── t1
The number of sub-directories can be quite large. How to find the number of files in each sub-directories here?
You can use this piece of script to find the number of files in sub directories:
for i in `ls -1`; do
echo $i; find $i -type f | wc -l;
done