How to find number of subdirectories in a given directory?

Use the following command to find the list of sub directories from the current directory.

  $ find . -type d | wc -l

To find number of files in a given directory.

  $ find . -type f | wc -l

Search