How to count lines of code in Mac? Here's a way to check several file formats:
1. Count the number of lines of code in an XML file
use the following command
find . "(" -name "*.xml" ")" -print | xargs wc -l
2. Count the number of lines of java code
use the following command
find . "(" -name "*.java" ")" -print | xargs wc -l
3. Count the number of lines of code in files such as .m .h .cpp .mm
use the following command
find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.c" ")" -print | xargs wc -l