1.常规的查找(最常用)
less 然后到最下面 然后用问号,向上搜索
less catalina.out
shift+g
ctrl+c
?关键字
n向上找
shift+n向下找
2.查找多个关键字,and关系
grep 'xxx出函接口' catalina.out| grep '1472822569270910977'
12-20 17:05:10.762 INFO [xak4fk] com.ruoyi.web.controller.tbl.TBLGuaranteeController - [out,47] - hashCode:[1420653543],xxx出函接口,请求解密报文:{"insuranceNo":"1472822569270910977","payAccount":"1","payAccountName":"福建1建设工程有限公司"}
3.查找关键字,or关系
egrep 'xxx出函接口|1472822569270910977' catalina.out
12-21 09:40:07.734 INFO [skuiuh] com.ruoyi.web.controller.tbl.TBLGuaranteeController - [out,47] - hashCode:[1420653543],xxx出函接口,请求解密报文:{"insuranceNo":"1472757516215656449","payAccount":"1","payAccountName":"程有限公司"}
12-21 09:40:08.685 INFO [y5iuy8] com.ruoyi.web.controller.tbl.TBLGuaranteeController - [out,47] - hashCode:[1420653543],xxx出函接口,请求解密报文:{"insuranceNo":"1472766130737258498","payAccount":"1","payAccountName":"工程有限公司"}
12-21 09:40:09.690 INFO [mvu7ah] com.ruoyi.web.controller.tbl.TBLGuaranteeController - [out,47] - hashCode:[1420653543],xxx出函接口,请求解密报文:{"insuranceNo":"1473104100019281922","payAccount":"1","payAccountName":"展有限公司"}
后面还有很多就不复制了
4.查找符合记录的条数
grep '诺诺2.0查询发票响应-金融' catalina.out |grep '开票中' | wc -l
4835