liunx日志文件记录
日志相关
1.查看實時日志: tail -F 例如 : tail -F /logs/ricexxx-xxx.log
2.查看歷史日志: less 例如: tail -F /logs/ricexxx-xxx.log
3.查看日志並顯示行號: less -N 例如: less -N /logs/ricexxx-xxx.log
4.监控最后n行日志文件的变化 例如: tail -100f /logs/ricexxx-xxx.log
5.从第10行开始向后显示100行 cat -n less /logs/ricexxx-xxx.log |tail -n +10 | head -n 100
6.跳轉到100行 less +100 -N /logs/ricexxx-xxx.log
grep相關(正則匹配)
-B 行数 向后显示n行
-A 行数 向前显示n行
-C 行数 上下各n行
-i 忽略大小写
-v 反向匹配,选出没匹配上的内容