sed 按时间截取日志

Posted on Posted in command
sed -n '/2018-04-22/,$p' catalina.out # 某时间到现在的系统日志
sed -n '/2018-04-22 13:56:00/,/2018-04-22 13:59:00/p' catalina.out-20180423 # 时间区间日志
sed -n '/2018-04-22 13:[0-9][0-9]:[0-9][0-9]/,/2018-04-22 13:[0-9][0-9]:[0-9][0-9]/p' catalina.out-20180423 # 正则
» 转载请注明来源:若我若鱼 » sed 按时间截取日志

Leave a Reply

Your email address will not be published. Required fields are marked *

17 + four =