count all files in a directory and subdirectory linux code example
Example 1: linux count files in subdirectories
find . -type f | cut -d/ -f2 | sort | uniq -c | sort -nr
Example 2: bash how many files in a directory
ls -1q log* | wc -l
Example 3: list all files in a directory and subdirectory linux
find . -type f -follow -print