Count lines of code


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



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324394557&siteId=291194637