count files in linux directory code example
Example 1: linux count files in subdirectories
find . -maxdepth 1 -type d | while read -r dir
do printf "%s:\t" "$dir"; find "$dir" -type f | wc -l; done
Example 2: count number of lines in directory linux
find . -name '*.php' | xargs wc -l