take how many files in a directory linux code example
Example 1: bash how many files in a directory
ls -1q log* | wc -l
Example 2: how to check how many files are in a folder linux
$ ls | wc -l
ls -1q log* | wc -l
$ ls | wc -l