How To Wiki
Register
No edit summary
(No difference)

Revision as of 10:54, 6 September 2007

You can use find and awk to counting the total number of lines in multiple files

Solution

Using the usual GNU tools, you can write the following script (replace "*.java" with your language file type):

find . -name "*.java" -exec wc -l '{}' \; | awk '{ sum += $1 } END { print sum }'