Archive for September, 2009

Counting All Files in a Linux Directory

Sunday, September 27th, 2009

To count how many files there are in a directory using the terminal on a Linux machine you can combine 2 commands:

  • find
  • wc

We’ll use the find command to locate all the files (and exclude directories and other non-files) and then the wc command to count the files.

(more…)