grep

grep用法之--binary-files 参数

--------------------------------------------------------------

examples 1:--binary-files 参数

1、查找某个目录及子目录下包含特定字符的文件,不查找二进制文件

   grep -rn “wl0505” /etc/*  --binary-files=without-match

2、快速搜索代码

   read -e -p "current dir search:" s; read  -e -p "Exclude-file:" f; grep -irn "$s" ./ --exclude-dir={.git, .svn} --exclude={*.o,*.o.i,*.ii,*.d,$f} --binary-files=without-match  

 

注:更多详情可以查看 man grep 帮组

posted @ 2019-12-19 10:29  口袋呆呆  阅读(139)  评论(0编辑  收藏  举报