mgrep多行 grep 工具

联合创作 · 2023-09-29 06:18

mgrep 是一个执行多行 grep 的扩展工具。其设计目的并不是为了替换 grep,而是兼容 grep ,实现对 grep 的扩展。

示例用法:

# 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
浏览 3
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报