iOS counts the number of lines of code

Open terminal

cd to the directory where the project is located

Include blank lines and comments

find . -name "*.m" -or -name "*.h" -or -name "*.xib" -or -name "*.c" |xargs wc -l 

Press Enter, to execute this instruction is to get the number of lines of code in each file, and count the total number of lines of code at the end.

 

No blank lines, comments

find . -name "*.m" -or -name "*.h" -or -name "*.xib" -or -name "*.c" |xargs grep -v "^$"|wc -l 

 

Guess you like

Origin blog.csdn.net/bitcser/article/details/93849197