Wiki‎ > ‎

Recursively count files in a Linux directory

posted Jan 9, 2015, 10:37 AM by Danny Xu
find DIR_NAME -type f | wc -l


  • -type f to include only files.
  • | redirects find's command output to wc command.
  • wc (short for word count) counts newlines, words and bytes on its input (docs).
  • -l to count just newlines.