count the number of files in a directory recursively linux code example Example: how to count all files in a directory linux recursively find DIR_NAME -type f | wc -l