tail -f example.log
-- 查阅正在改变的日志文件,最尾部的内容显示在屏幕上,并且不但刷新
tail -n 10 example.log
-- 查询日志尾部最后10行的日志;
tail -n +10 example.log
-- 查询10行之后的所有日志;
cat -n example.log | grep "关键字"
-- 查看匹配关键字的日志,并显示行号
cat -n example.log | tail -n +1000 | head -n 200
-- 查看1000行之后的头200行
sed -n '/2018-06-01 16:00:00/,/2018-06-01 17:00:00/p' example.log
-- 查找指定时间段的日志,上面的两个日期必须是日志中打印出来的日志,否则无效.