How to count the number of files in a directory
Feb 8, 2011
1 minute read

How to count the number of files in a directory

Non recursive

find targetdir -type f -maxdepth 1 | wc -l 

Recursive

find targetdir -type f | wc -l 
find targetdir -type f -follow | wc -l 


comments powered by Disqus