bash count files matching pattern code example
Example 1: bash count files in directory recursively matchingattern
ls -Uba1 | grep ^log | wc -l
Example 2: bash count files in directory recursively matchingattern
find . -type f -name '*.log' -printf x | wc -c