日志
关键字查询
查询文件名为test.log 关键字为debug的日志
cat -n test.log |grep “debug”
行号查询
查询名为test.log的日志从92行开始,往后20行的数据
cat -n test.log |tail -n +92|head -n 20
查看ERROR日志
查询test.log中ERROR级别的日志
cat -n test.log |grep “ERROR”
注意error要大写,如果小写的话可能搜到别的打印出的日志
查看关键日志并分页
查询test.log中92行后,往后500行的日志,并分页查看
cat -n test.log |tail -n +92|head -n 500|less