I am using the following command for counting the lines of text in JAVA files:
find . -name '*.java' | xargs wc -l
How can I modify the find command parameters to match more than one file extension? For example, I would like use the above operation for CPP, C, and H files.
findcommand, since that is where you are searching for matching files. – iglvzx Apr 24 '12 at 23:48find -print0 | xargs -0construct or even better and simpler:find . -name '*.cpp' -o -name '*.c' -o -name '*.h' -exec wc -l {} +. This will avoid any file name issues (blank spaces, new lines and so on) and is (very) good custom. – Daniel Andersson Apr 25 '12 at 6:39