number of files in subdirectories code example Example: linux count files in subdirectories find . -type f | cut -d/ -f2 | sort | uniq -c | sort -nr