iOS counts source code lines

If you want to count ios development code, including header files, enter the project directory with the terminal command, the command is as follows

1. List the number of lines in each file

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

2. List the total number of lines of code, grep -v "^$" is to remove the blank line comments and count them in the amount of code, after all, it is also written word by word

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

 

Guess you like

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