linux--日志文件过大?查看日志文件某个时间段的内容

某个时间段的日志输出到新文件

sed  -n '/2020-06-17 17:00:00/,/2020-06-17 18:50:59/p'  nohup.out >> 061717.log 

查看文件大小

ll -lh 061717.log 

将最近200行文件输出到新文件

sudo tail -200 nohup.out > test1.log
原文地址:https://www.cnblogs.com/lutt/p/13579825.html