more catalina.out |grep -n --color=auto 'id:12332312312313'|grep --color=auto 'error'
sed -n '30745,30790p' catalina.out
linux系統中,可以利用grep查看指定的內容,
比如:grep “123” test.log //查看test.log中包含123字符的日志
如果想查看指定內容上下幾行,可以用參考下面的用法:
$grep -10 ‘123’ test.log//打印匹配行的前后10行
或
$grep -C 10 ‘123’ test.log//打印匹配行的前后10行
或
$ grep -A 10 -B 10 ‘123’ test.log //打印匹配行的前后10行
$grep -A 10 ‘123’ test.log //打印匹配行的后10行
$grep -B 10 ‘123’ test.log//打印匹配行的前10行