打开终端,用cd命令 定位到工程所在的目录,然后调用以下命名即可把每个源代码文件行数及总数统计出来
1 | find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" -or -name "*.swift" ")" -print | xargs wc -l |
改进:
去掉空行
xargs grep -v“^ $”
1 | find . -name "*.m" -or -name "*.h" -or -name "*.xib" -or -name "*.c" -or -name "*.swift" |xargs grep -v "^$"|wc -l |
![](http://lovediary-oss.uilucky.com/blog/source/assets/blogimage/%E6%89%AB%E7%A0%81_%E6%90%9C%E7%B4%A2%E8%81%94%E5%90%88%E4%BC%A0%E6%92%AD%E6%A0%B7%E5%BC%8F-%E6%A0%87%E5%87%86%E8%89%B2%E7%89%88.png?x-oss-process=style/resize)
本文作者: NUK
最后更新: 2023年12月13日 17:35:03
本文链接: http://www.uilucky.com/post/7b044cfa.html
版权声明: 本作品采用 CC BY-NC-SA 4.0 许可协议进行许可,转载请注明出处!