001、
[root@PC1 test03]# ls file.txt [root@PC1 test03]# cat file.txt ## 测试数据 match random text line 1 match match match random text line 2 match random text line 3 match match random text line 4 match random text line 5 match random text line 6 match random text line 7 match random text line 8 match match random text line 9 ## 输出连续匹配字符的下一行 [root@PC1 test03]# awk '{if($0 ~ /^match$/) {count++; next}; if(count > 1) {print $0}; count = 0}' file.txt random text line 2 random text line 4 random text line 9
参考:https://www.codenong.com/39600858/
标签:字符,匹配,text,random,file,linux,line,txt,match From: https://www.cnblogs.com/liujiaxin2018/p/17534179.html