首页 > 其他 > 详细

统计代码行数

时间:2018-05-15 18:12:24      阅读:130      评论:0      收藏:0      [点我收藏+]

下面举几个例子:

1.统计当前目录下,py文件数量:

  1. find . -name "*.py" |wc -l

2.统计当前目录下,所有py文件行数:

  1. find . -name "*.py" |xargs cat|wc -l

3.统计当前目录下,所有py文件行数,并过滤空行:

  1. find . -name "*.py" |xargs cat|grep -^$|wc -l
     Usage: wc [OPTION]... [FILE]...
        -c, --bytes, --chars print the byte counts
        -l, --lines print the newline counts
        -L, --max-line-length print the length of the longest line
        -w, --words print the word counts
            --help display this help and exit
            --version output version information and exit

     

统计代码行数

原文:https://www.cnblogs.com/iceman-/p/9042294.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!