美文网首页
LINUX 查看某个指定时间段的日志

LINUX 查看某个指定时间段的日志

作者: 逍遥无铭 | 来源:发表于2019-03-04 11:46 被阅读0次

sed -n '/Jun 17 13:39:54/ , /Jun 18 10:50:28/p' kern.log

https://superuser.com/questions/439688/how-to-grep-a-log-file-within-a-specific-time-period

按分钟段查看日志:

下面这种方式,显示的信息不全,只显示出含有该时间的行,像换行显示的错误堆栈日志,就显示不出来。

grep '2019-03-02 11:4[1-2]' user-center.2019-03-02.log

按秒数段查看日志:

grep '2019-03-02 11:42:[01-59]' user-center.2019-03-02.log

相关文章

网友评论

      本文标题:LINUX 查看某个指定时间段的日志

      本文链接:https://www.haomeiwen.com/subject/khbbuqtx.html