linux 系统 查日志

linux系统中利用grep打印匹配的上下几

//打印匹配的前后50
$grep -50 'parttern' all.log

//打印匹配行的前后50
$grep -C 50 'parttern' all.log