首页 > 其他 > 详细

grep使用

时间:2015-08-18 07:52:51      阅读:1521      评论:0      收藏:0      [点我收藏+]

grep常用的使用方法

grep –rns “match_content”filename 查看匹配内容的行

find /path –name “*.h” –o –name “*.cpp” | xargs grep –rn “match_content”在特定的文件类型中查找

grep –rns “match_content” –A10 –B10 filename > logfile  将匹配到的行的附近内容输入到其他文件

grep –w “match_content”filename  精确匹配

grep –I “match_content” filename 不区分大小写匹配

grep –v “match_content” filename 显示不包含匹配文本的其他行

grep使用

原文:http://www.cnblogs.com/zhouLee/p/4738249.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!