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

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行
阅读更多 登录后自动展开
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页