参考链接:https://www.cnblogs.com/sunfuyou/p/7921538.html

1、打开终端

2、cd 空格 将工程的文件夹拖到终端上,回车,此时进入到工程的路径

此时已经进入到工程文件夹下

3、运行指令

(第一个方案:)

find . -name "*.m" -or -name "*.h" -or -name "*.xib" -or -name "*.c" |xargs wc -l 【最后一个字母是L不是数字1】

回车,执行--这条指令是获取每个文件内的代码行数,并在最后统计出一共的代码行数【注释也统计在代码量之内

和文件内的代码行数对比一下:数目是正确的。

(第二个方案:)

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

这条指令是获取代码总行数,去掉空行。grep -v "^$"是去掉空行。注释也统计在代码量之内。

还有其他的命令:

find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l
-name  "*.m" 就表示扩展名为.m的文件。

统计java文件和xml文件的命令分别是:
find . "(" -name "*.java"  ")" -print | xargs wc -l
find . "(" -name "*.xml"  ")" -print | xargs wc -l

最新文章

  1. C#设计模式系列:工厂方法模式(Factory Method)
  2. wikioi 2235 机票打折 【考查浮点数四舍五入的技巧】
  3. linux 分区
  4. python使用tesseract-ocr完成验证码识别(模型训练和使用部分)
  5. STL - priority_queue(优先队列)
  6. Python内置函数(41)——max
  7. 16.python-I/O模型
  8. zabbix监控概念
  9. c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit();Application.ExitThread(); System.Environment.Exit(0);
  10. [leetcode]156.Binary Tree Upside Down颠倒二叉树
  11. Tomcat8源码笔记(一)Lifecycle接口
  12. mysql-binlog_cache_size
  13. js获取变量的值
  14. bootstrap-table 应用
  15. 51CTO 资料汇总 截止20150504
  16. ThinkPHP项目笔记之函数篇
  17. 《Java程序设计》实验1实验报告
  18. 码云+jenkins+自动回复邮件
  19. YUV转为RGB24及IplImage格式(I420和YV12)及Java版实现
  20. convolutional neural network 课程笔记

热门文章

  1. CPL学习笔记(二)
  2. Linux - mkdir -p a/b/c
  3. paper:synthesizable finit state machine design techniques using the new systemverilog 3.0 enhancements之enhanced coding styles
  4. laravel中使用PHPQuery实现网页采集
  5. loc与iloc函数的使用
  6. (转)iOS平台UDID方案比较
  7. 查看 EGLIBC 版本
  8. poj 3281 Dining(网络流+拆点)
  9. splay模板三合一 luogu2042 [NOI2005]维护数列/bzoj1500 [NOI2005]维修数列 | poj3580 SuperMemo | luogu3391 【模板】文艺平衡树(Splay)
  10. 微信小程序开发 -- 获取当前页面路径