grep匹配某个次出现的次数

cat file | grep  -c 'xxx'  统计xxx在file中出现的行数

cat file | grep  -o 'xxx'  统计xxx在file中出现的次数

原文地址:https://www.cnblogs.com/students/p/8821118.html