grep

作者: Jalon | 来源:发表于2017-03-06 17:38 被阅读0次
grep -[acinv] '搜索内容串' filename
-a 以文本文件方式搜索
-c 计算找到的符合行的次数
-i 忽略大小写
-n 顺便输出行号
-v 反向选择,即找 没有搜索字符串的行
也可以通过 >> temp.txt 输出到文件
也可以书写正则

管道符处理原理,你也可以和其他处理叠加 如:
ll -a|grep -ni '.txt$'
![Paste_Image.png](https://img.haomeiwen.com/i4551/5a2eea6f0ed3843b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

相关文章

网友评论

      本文标题:grep

      本文链接:https://www.haomeiwen.com/subject/qveugttx.html