Linux 统计多个文件中 某字符串出现的行数

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_28766327/article/details/79136185
cat log_0 log_1 log_2 log_3 log_4 log_5 log_6 log_7 log_8 log_9 | grep "object has no attribute" | wc -l

或者 
cat log_* | grep "object has no attribute" | wc -l

1、先用cat命令读入多个文件
2、用grep 找到需要的行
3、用 wc -l 统计行数

猜你喜欢

转载自blog.csdn.net/qq_28766327/article/details/79136185