I am trying to get a count of the subdirectories and all the files total in all the subdirectories within a directory in Unix. I tried this:
ls -lR | grep ^d | wc -l
but that just gives me the total subdirectories, not the total files. How would I modify this or is there a way to find out both numbers from one command? Or should I split this into two?