linux grep查看指定内容上下几行

linux系统中,能够利用grep查看指定的内容, 好比:grep “123” test.log //查看test.log中包含123字符的日志linux 若是想查看指定内容上下几行,能够用参考下面的用法:web $grep -10 ‘123’ test.log//打印匹配行的先后10行 或 $grep -C 10 ‘123’ test.log//打印匹配行的先后10行 或 $ grep -A 1
相关文章
相关标签/搜索