Skip to content

Commit 669e749

Browse files
committed
新增统计项目代码行数命令
1 parent 82f1128 commit 669e749

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Linux.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,19 @@ ubuntu 解压 RAR
170170
$ sudo apt-get install rar
171171
# 解压
172172
$ rar x FileName.rar
173+
```
174+
175+
统计当前目录下指定后缀名的文件总个数命令
176+
```
177+
$ find . -name "*.html" | wc -l
178+
```
179+
180+
统计项目目录中代码行数
181+
```
182+
# 指定后缀
183+
$ find . -type f -name "*.py" | xargs wc -l
184+
# 指定后缀(方式二)
185+
$ find . -name "*.py" | xargs wc -l
186+
# 过滤某些后缀
187+
$ find . -type f ! -name "*.pyc" | xargs wc -l
173188
```

0 commit comments

Comments
 (0)