Let it counting *.h *.cpp in Sub directory.
+4
A:
If you want it seperate per file:
find -type f \( -name "*.h" -o -name "*.cpp" \) -exec wc {} \;
if you want the accumulated sum:
find -type f \( -name "*.h" -o -name "*.cpp" \) -exec cat {} \; | wc -l
theomega
2010-08-24 16:10:47
A:
Use zsh instead of bash:
wc **/*.(cpp|h)
This will expand out to all the .cpp and .h files in the current directory and all subdirectories.
Dave Kirby
2010-08-24 16:38:39