count files in directory linux recursive code example
Example 1: count files recursively linux
find DIR_NAME -type f | wc -l
Example 2: how to count all files in a directory linux recursively
find DIR_NAME -type f | wc -l
Example 3: bash count files in directory recursively matchingattern
find . -type f -name '*.log' -printf x | wc -c
Example 4: bash count files in directory recursively matchingattern
ls -Uba1 | grep ^log | wc -l