grep使用多个查询条件--或

推荐方法

\| 符号法

[root@mail ~]# grep 'usrquota\|grpquota' /etc/fstab扩展

 

其余方法

『1』使用多个 -e 参数

如:grep

netstat -an | grep -E "ESTABLISHED|WAIT"方法

注意:tab

netstat -an | grep -e EST -e WAITmail

并列使用多个 -e参数能够实现或条件参数

 

『2』使用扩展 -E

netstat -an | grep -E "ESTABLISHED|WAIT"ab

此处的 -E 是大写 ,匹配条件必定要加 引号

相关文章
相关标签/搜索