April 22, 2013

Counting a files

This'll be the third time I'm listing something about find. This time I'm using it to count the number of files in a directory. At work I needed to know if a specific folder would break one of our tools because it might have too many files. (Long story)

 
# find YOURDIR -type f ¦ wc -l 

Its the wc that does the actual counting by adding up each line from find.

No comments: