码迷,mamicode.com
首页 > 其他好文 > 详细

使用grep查找字符串

时间:2018-03-22 19:22:43      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:pre   tac   string   grep   ring   log   bsp   字符   查找   

如下:

grep -r ‘target string‘ --exclude=‘pattern dir/

例子:

grep -r Debug --exclude=*.js ./

 

查找本目录下除了js文件以外的所有文件,找到包含‘Debug’字符串的文本行。

 

 

ref: https://unix.stackexchange.com/questions/125360/how-to-specify-matching-patterns-while-excluding-some-files-having-a-pattern-in

使用grep查找字符串

标签:pre   tac   string   grep   ring   log   bsp   字符   查找   

原文地址:https://www.cnblogs.com/pinganzi/p/8625237.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!