linux查看日志过滤写法(TODO 待汇总)

 

tail -fn 200 logs/catalina.out | grep -E "手动|账单数据|供应商|话单|同步" --color

 

 

 

tail -fn 500   logs/catalina.out  |grep  "=20181010" -C 10

 

 

切割日志文件

sed -n '/2019-03-12 00:00:00/,/2019-03-13 00:00:00/p' catalina.out > charge20190312.log
 

或 :grep -E "46421aaaaaa12c7e30fff | http-nio-18080-exec-357" debug.2019-04-25.log --color -C 1
并: grep "httpaaa-exec-357"  debug.2019-04-25.log | grep "4642wwwww28a7bf2d12c7e30fff" --color -C 1

 

 

查询某一时间段日志:我要查shop-bussiness.log.2018-11-06文件中2018年11月6号11:34至11点37之间的日志信息,可以这么做:

grep   '2018-Nov-06 11:3[4-7]' shop-bussiness.log.2018-11-06

你可能感兴趣的:(Linux)