a一级爱做片免费观看欧美,久久国产一区二区,日本一二三区免费,久草视频手机在线观看

博客專欄

EEPW首頁 > 博客 > Linux統計項目代碼行數-wc

Linux統計項目代碼行數-wc

發布人:電子禪石 時間:2020-02-06 來源:工程師 發布文章
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


打開終端,用cd命令定位到工程所在的目錄,然后調用以下命名即可把每個源代碼文件行數及總數統計出來:

find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" -or -name "*.rss" ")" -print | xargs wc -l

上面命令可以搜索這個工程。但包含了空格。

find . "(" -name "*c" -or -name "*.h" -or -name "*cpp" ")" -print | xargs wc -l

下面舉幾個例子:

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 -v ^$|wc -l


*博客內容為網友個人發布,僅代表博主個人觀點,如有侵權請聯系工作人員刪除。

繼電器相關文章:繼電器工作原理


時間繼電器相關文章:時間繼電器




關鍵詞:

相關推薦

技術專區

關閉