<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>
"); //-->

博客專(zhuān)欄

EEPW首頁(yè) > 博客 > Linux下源代碼行數統計工具(sloccount, cloc等)

Linux下源代碼行數統計工具(sloccount, cloc等)

發(fā)布人:電子禪石 時(shí)間:2020-02-07 來(lái)源:工程師 發(fā)布文章

重點(diǎn):發(fā)現cloc 非常好用,直接就出結果:

99.png

在windows下總是有很多源代碼統計工具, 比如SourceCounter(源代碼統計精靈)等工具

之前我總是使用如下命令統計源代碼的信息, 繁瑣而可讀性差

find . -type f -name "*.[hc]" | xargs cat | wc -l

或者

 find . -name "*.[hc]" | xargs -L 1 wc -l | awk '{print $1}' | while read num; do total=$((total+num)); echo $total; done
1  sloccount源代碼行數統計工具

sloccount=Count Source Lines Of Code

官網(wǎng) : http://www.dwheeler.com/sloccount/


1.1   Ubuntu安裝
sudo apt-get install sloccount
1.2   使用
sloccount  [--version]  [--cached]  [--append]  [  --datadir directory ]
       [--follow]  [--duplicates]  [--crossdups]  [--autogen]  [--multiproject]
       [--filecount] [--wide] [--details] [ --effort F E ] [ --schedule F E ] [
       --personcost cost ] [ --overhead overhead ] [  --addlang  language  ]  [
       --addlangall ] [--] directories
--cached

跳過(guò)計算過(guò)程,直接使用上次結果
參數     描述
–multiproject     如果該文件夾包括一系列的子文件夾,而它們中的每一個(gè)都是相對獨立開(kāi)發(fā)的不同的項目,那么使用”–multiproject”選項,評估將會(huì )正確的考慮到這一點(diǎn)
–filecount     顯示文件數目而非代碼行數
–details     顯示每個(gè)源文件的詳細信息
–duplicates     算上所有重復的(默認情況下如果文件有相同的內容,則只算一個(gè))
–crossdups     如果頂目錄包含幾個(gè)不同的項目,并且你想把不同的項目下重復的文件在每個(gè)項目中都算上一次,則使用該選項
————————————————

2  cloc代碼行數統計工具

cloc也可以用來(lái)統計源代碼的行數, 其本質(zhì)是一個(gè)perl的腳本。

安裝

91.png



其本質(zhì)是一個(gè)perl的腳本, 可以用

file `which cloc`

可以使用

cat `which cloc`

查看其源代碼的信息

92.png

https://blog.csdn.net/gatieme/article/details/52791294


*博客內容為網(wǎng)友個(gè)人發(fā)布,僅代表博主個(gè)人觀(guān)點(diǎn),如有侵權請聯(lián)系工作人員刪除。



關(guān)鍵詞:

相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>