Linux常用日志查询方法
- 查询实时日志中包含Exception或error的内容
-
tail -f *.log | grep -E 'Exception|ERROR' --color=auto
- 查询指定行之间的内容 第2行 到第5行的内容 2 3 4 5 共4行的内容查询指定行之间的内容 第2行 到第5行的内容 2 3 4 5 共4行的内容
-
sed -n '2,5p' test.log

tail -f *.log | grep -E 'Exception|ERROR' --color=auto
sed -n '2,5p' test.log
