bash count files in directory recursively by extension code example
Example 1: count files recursively linux
find DIR_NAME -type f | wc -l
Example 2: bash count files in directory recursively matchingattern
find . -type f -name '*.log' -printf x | wc -c