先安裝cloc工具:
sudo apt install cloc
然後在專案的根目錄下執行:
cloc .
得到如下內容:
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Go 17 302 209 1238
Python 2 65 72 171
YAML 1 12 2 123
JSON 2 0 0 15
Dockerfile 2 7 9 9
Markdown 1 0 0 1
-------------------------------------------------------------------------------
SUM: 25 386 292 1557
-------------------------------------------------------------------------------