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