1、根据关键字查询日志
cat xxx.log | grep "关键字" -A5 查询关键字相关日志后5行
cat xxx.log | grep "关键字" -B5 查询关键字相关日志前5行
zcat 查询打包了的日志
tail -100f xxx.log 监控尾部日志
tail -n 5 xxx.log 查看日志尾部5行
head -n 5 xxx.long 查看日志前5行
cat xxx.log | grep -v "关键字" 查询不包括“关键字”的日志
1、根据关键字查询日志
cat xxx.log | grep "关键字" -A5 查询关键字相关日志后5行
cat xxx.log | grep "关键字" -B5 查询关键字相关日志前5行
zcat 查询打包了的日志
tail -100f xxx.log 监控尾部日志
tail -n 5 xxx.log 查看日志尾部5行
head -n 5 xxx.long 查看日志前5行
cat xxx.log | grep -v "关键字" 查询不包括“关键字”的日志