I want to count the number of files in a directory and it´s subdirectories
find DIR_NAME -type f -print | wc -l
The f in -type f stands for files and wc -l for word count lines. Remove the -type f to include directories in the count
Source: http://stackoverflow.com/questions/9157138/how-to-recursively-count-files-in-a-linux-directory