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

网友评论