统计项目代码总行数

作者:iohannes 发布时间: 2025-07-11 阅读量:7

windows

(Get-ChildItem -Recurse -Include *.js,*.py,*.html,*.css | Select-String .).Count

linux

find . -name "*.js" -o -name "*.py" -o -name "*.html" -o -name "*.css" | xargs cat | grep -v '^\s*$' | wc -l
  • *.js,*.py 等为你需要的文件扩展名
  • grep -v '^\s*$' 用于过滤空行