多行 grep 工具 mgrep

jopen 12年前發布 | 32K 次閱讀 grep Linux

mgrep 是一個執行多行 grep 的擴展工具。其設計目的并不是為了替換 grep,而是兼容 grep ,實現對 grep 的擴展。

 多行 grep 工具 mgrep

示例用法:

# Search for lines with "Romeo" in the file shakespeare-romeo_and_juliet:
mgrep Romeo shakespeare-romeo_and_juliet

# Count the number of include directives in each .cc file:
mgrep -c '#include' *.cc

# List those files that have "John Doe" in them, regardless of capitalization:
mgrep -il 'John Doe' *.cc

項目主頁:http://www.baiduhome.net/lib/view/home/1346919186225

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!