how many files in 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