ubuntu中快速简单统计代码行数信息

使用cloc在ubuntu内统计代码行数

1.安装cloc工具

sudo apt-get install cloc

2.进入需要统计的目录内
执行

cloc .

这里cloc 后面有一个点 表示需要统计该目录下的文件
也可以的改成具体的文件名或者文件目录

3.显示具体内容

alpha@ubuntu:~/git/bk$ cloc .
      60 text files.
      60 unique files.                              
      50 files ignored.

http://cloc.sourceforge.net v 1.60  T=0.48 s (99.7 files/s, 16824.4 lines/s)
--------------------------------------------------------------------------------
Language                      files          blank        comment           code
--------------------------------------------------------------------------------
Go                               39            576            525           4176
HTML                              6           1107            178           1482
Bourne Shell                      2              3              8             26
Bourne Again Shell                1              2              0             13
--------------------------------------------------------------------------------
SUM:                             48           1688            711           5697
--------------------------------------------------------------------------------

这里显示了文件目录中的文件数(files)、空白行数(blank)、注释行数(comment)和代码行数(code)。
附官网:http://cloc.sourceforge.net/

猜你喜欢

转载自blog.csdn.net/zkt286468541/article/details/81330660