find . "(" -name "*.m" -or -name "*.h" -or -name "*.mm" -or -name "*.cpp" ")" -print0 | xargs -0 wc -lYou will get an result similar like this one:
terminal output |
So now you know the lines per file and at the end the lines total of all the *.h and *.m files.