Linux 大文件日志快速定位错误或者异常的位置

1.得到错误日志或者异常日志的行号

cat -n test.log |grep "error" 

cat -n test.log |grep "exception"

2. 通过位置往前往后查看日志详细

//339563 can not close IO 查询语句在 339500 -339600行中 ||100代表在339500 往后看100行

 cat -n test.log |tail -n +339500 |head -n 100  

猜你喜欢

转载自www.cnblogs.com/woshixiangshang/p/11585306.html