bash count the files start with in all directory code example Example: bash count files in directory recursively matchingattern ls -Uba1 | grep ^log | wc -l