tail:
-n 是显示行号;
tail -n 10 test.log 查询日志尾部最后10行的日志;
tail -n +10 test.log 查询10行之后的所有日志;
Ctrl+c 是退出tail命令
head:
head -n 10 test.log 查询日志文件中的头10行日志;
head -n -10 test.log 查询日志文件除了最后10行的其他所有日志;
cat/tac:
tac是倒序查看
cat -n test.log |grep "xxx" 查询关键字的日志