egrep
egrep
在文件内查找指定的字符串
补充说明
egrep命令 用于在文件内查找指定的字符串。egrep执行效果与grep -E
相似,使用的语法及参数可参照grep指令,与grep的不同点在于解读字符串的方法。egrep是用extended regular expression语法来解读的,而grep则用basic regular expression 语法解读,extended regular expression比basic regular expression的表达更规范。
语法
|
|
实例
显示文件中符合条件的字符。例如,查找当前目录下所有文件中包含字符串"Linux"的文件,可以使用如下命令:
|
|
结果如下所示:
|
|
过滤注释行和空白行
|
|
- 原文作者:lex
- 原文链接:https://blog.mineor.xyz/posts/linux%E5%91%BD%E4%BB%A4/egrep/
- 版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议进行许可,非商业转载请注明出处(作者,原文链接),商业转载请联系作者获得授权。