一行命令统计iOS工程代码总行数
2023-03-31 11:08:46 时间
我们有时候想要统计一下我们的工程的总代码行数,来获取一些成就感或者作为别的用图,这里就介绍一些如何便捷地统计代码的行数,非常简单,方法如下:
1.打开终端;
2.通过cd命令到达我们的工程文件,这里注意如果要避免统计引用的第三方库的代码量,我们就要进一步进到我们自己写的代码文件中去,一般是一个与工程文件同名的文件;
3.统计代码行数:
如果想列出每个文件的行数,输入命令:
- find.-name"*.m"-or-name"*.h"-or-name"*.xib"-or-name"*.c"|xargswc-l
如果想直接列出总代码行数,输入命令:
- find.-name"*.m"-or-name"*.h"-or-name"*.xib"-or-name"*.c"|xargsgrep-v"^$"|wc-l
这样就可以直接得出数量了,而且非常快,是不是很方便~
这个统计过程会去掉空行,但注释是会计算在内的。
相关文章
- 《Motion Design for iOS》(二)
- [译]《iOS Human Interface Guidelines》——Progress View进度视图
- 《Motion Design for iOS》(三)
- [译]《iOS Human Interface Guidelines》——Segmented Control分段控件
- [译]《iOS Human Interface Guidelines》——Slider滑动条
- 《Motion Design for iOS》(四)
- [译]《iOS Human Interface Guidelines》——Stepper步进控件
- [译]《iOS Human Interface Guidelines》——System Button系统按钮
- 《Motion Design for iOS》(五)
- [译]《iOS Human Interface Guidelines》——Text Field文本域
- [译]《iOS Human Interface Guidelines》——Alert警告框
- 《Motion Design for iOS》(六)
- windows下安装jupyter notebook
- 《Motion Design for iOS》(七)
- mac下怎么在终端打开jupyter
- [译]《iOS Human Interface Guidelines》——Template Icons模板图标
- 北上深 3 城 | 腾讯云 3 天搞定企业容器化改造实战营精彩回顾
- 典型的 Serverless 无服务器应用架构
- SuperEdge再添国产智能加速卡支持,为边缘智能推理再提速10倍
- pycharm快捷键如何快速跳到一行末尾