🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

calculate the total line numbers of files in directory

Started by
3 comments, last by baumep 16 years, 4 months ago
I want to calulate the total line numebers of the files(*.h *.cpp) in certain directory(include its subdirecories). How to I write the command? cat ./tmp/*.h | wc -l
akira32 編程之家 Yahoohttp://tw.myblog.yahoo.com/akira32-akira32
Advertisement
maybe wc -l `find -iname "*.h"`
Quote: Original post by Trenki
maybe wc -l `find -iname "*.h"`


The command you written does not work.

cat a/*.h a/*.cpp | wc -l
but cannot include the subdirectories.
akira32 編程之家 Yahoohttp://tw.myblog.yahoo.com/akira32-akira32
sloccount?

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Try:

find . -name "*.h" -o -name "*.cpp" | xargs wc -l
baumep

This topic is closed to new replies.

Advertisement