Linux – Recursively counting files in a directory

While development or migration of data we always have a requirement to count the number of files in the current directory or any directory.

How can we recursively count the files in a Linux directory?

where -type f to includes only files & wc -l to word count lines.

If you already in the current directory then simply type the following command :