get number of files in ls code example Example 1: count no of file in a directory in unix ls -1 | wc -l Example 2: how to check how many files are in a folder linux $ ls | wc -l