How to the number of files in a directory ls | wc -l works well for me. http://stackoverflow.com/questions/3702104/find-the-number-of-files-in-a-directory Read more: How to sort all files recursively by modification time in a directory on Linux? How to find files in a directory that are larger than certain size? How to find top K largest files in a directory on Linux? How to iterate all files and directories under a directory in Python? Finding the Number of Files (inodes) in a Directory on Linux How to get files without certain strings in their files names (reverse of *string*) on Linux? How to make taglist recognize specific files with certain extensions as C source files? Where are the backup files of my iPhone by iTune and how to get the real files from them?