Counting the number of all types of files
ls -lR /path/ | grep "^-" | wc -l
R represents searching for files in all subdirectories
^- represents searching for regular files
^d represents searching for directories
wc -l represents counting the number of output lines
Counting the number of specific type of files
ls -lR /path/ | grep "type" | wc -l