日志 查看匹配内容的前后几行

cat -n /opt/tomcat/logs/catalina.out |grep "property.cooperationResident.savebindCustomerHouse" |more

tail -f /opt/tomcat/logs/catalina.out | grep "com.agile.base.push" -i
匹配的字符串显示


grep -20 'property.cooperationResident.savebindCustomerHouse' /opt/tomcat/logs/catalina.out
//打印匹配行的前后20行

grep -A 20 'property.cooperationResident.savebindCustomerHouse' /opt/tomcat/logs/catalina.out
//打印匹配行的后20行

grep -B 20 'property.cooperationResident.savebindCustomerHouse' /opt/tomcat/logs/catalina.out

//打印匹配行的前20行
————————————————
版权声明:本文为CSDN博主「wind520」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wind520/article/details/79252254

posted @ 2021-12-01 15:34  取经中的稳健少年  阅读(353)  评论(0编辑  收藏  举报