日志

关键字查询

查询文件名为test.log 关键字为debug的日志
cat -n test.log |grep “debug”
linux常用命令合集

行号查询

查询名为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要大写,如果小写的话可能搜到别的打印出的日志
linux常用命令合集

查看关键日志并分页

查询test.log中92行后,往后500行的日志,并分页查看
cat -n test.log |tail -n +92|head -n 500|less
linux常用命令合集

参考文档

Linux之vim详解

linux查看日志的几种方法

常用Linux日志查看命令

相关文章:

  • 2021-11-28
  • 2018-08-09
  • 2021-12-02
  • 2021-11-22
  • 2021-11-04
  • 2021-11-22
  • 2021-11-23
  • 2021-12-05
猜你喜欢
  • 2021-11-05
  • 2018-07-17
  • 2021-12-31
  • 2020-10-27
  • 2018-05-08
  • 2021-11-01
  • 2021-10-16
  • 2019-11-29
相关资源
相似解决方案