1. cat xxxx.log | grep -A 30 '关键词' 查询该关键词以下30 行 日志
2. tail -f xxxx.log 查看运行的日志
3. cat -n xxxxx.log |grep "关键词" 查询关键字的日志 定位该行 所有
4. tail -100f test.log 实时监控100行日志
5. truncate -s 0 catalina.out 清理tomcat catalina.out 日志
6. cat -n xxxx.log | grep ERROR 查看错误日志
7. tail -f xxx.log | grep -C 36 error 查看错误日志的 后 36行 |