Getting the count of lines in a subdirectoryEdit
Example: cumulative total:
$ find . -type f -exec cat {} + | wc -l
Example: per file counts and total:
$ find . -regex '.+\.js$' | xargs wc -l
Source
- http://stackoverflow.com/questions/13727917/use-wc-on-all-subdirectories-to-count-the-sum-of-lines
- http://stackoverflow.com/questions/104756/how-do-you-count-your-lines-of-code
Alternatives
- http://cloc.sourceforge.net/ (Perl tool for counting source code)