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
相關文章
相關標籤/搜索