ls count files code example Example 1: count no of file in a directory in unix ls -1 | wc -l Example 2: bash how many files in a directory ls -1q log* | wc -l