egrep 是类 Unix 系统中的命令行工具,用于在文本中按扩展正则表达式(Extended Regular Expressions, ERE)进行搜索并输出匹配行。许多现代系统中,egrep 已被视为 grep -E 的等价写法(有的系统会提示已不推荐单独使用 egrep)。
/ˈiːɡrɛp/
I used egrep to find all lines containing an email address.
我用 egrep 查找所有包含电子邮箱地址的行。
Using egrep with a carefully designed pattern, the analyst scanned multiple log files to identify repeated authentication failures across different servers.
分析人员用精心设计的 egrep 模式扫描多个日志文件,识别不同服务器上反复出现的认证失败。
egrep 来自 grep(意为“搜索文本并打印匹配内容”)加上 e-(表示 extended,即“扩展的”)。它强调使用扩展正则(如 + ? | () 等在 ERE 中更常用的写法)。在很多实现里,egrep 只是 grep -E 的别名或同功能入口。
egrep 讲解文本检索与正则用法)grep/egrep 的使用场景)egrep/grep -E 的用法)egrep 及其等价形式)