[root@localhost ~]# cat name
my name is wei hongrao
her name is huangjinfeng
weihongrao and huanjinfeng
both name are from guangxi
[root@localhost ~]# grep -Ei "HONGRAO|JINFENG" name
my name is wei hongrao
her name is huangjinfeng
weihongrao and huanjinfeng
[root@localhost ~]# grep -i "HONGRAO" name | grep -i "JINFENG"
weihongrao and huanjinfeng
以下是等价的或方法
[root@localhost ~]# ls -l | grep -E "file$|name$"
drwxr-xr-x. 2 root root 4096 Aug 10 03:14 file
-rw-r--r--. 1 root root 102 Aug 10 20:19 name
[root@localhost ~]# ls -l | grep "file$" ; ls -l | grep "name$"
drwxr-xr-x. 2 root root 4096 Aug 10 03:14 file
-rw-r--r--. 1 root root 102 Aug 10 20:19 name
my name is wei hongrao
her name is huangjinfeng
weihongrao and huanjinfeng
both name are from guangxi
[root@localhost ~]# grep -Ei "HONGRAO|JINFENG" name
my name is wei hongrao
her name is huangjinfeng
weihongrao and huanjinfeng
[root@localhost ~]# grep -i "HONGRAO" name | grep -i "JINFENG"
weihongrao and huanjinfeng
以下是等价的或方法
[root@localhost ~]# ls -l | grep -E "file$|name$"
drwxr-xr-x. 2 root root 4096 Aug 10 03:14 file
-rw-r--r--. 1 root root 102 Aug 10 20:19 name
[root@localhost ~]# ls -l | grep "file$" ; ls -l | grep "name$"
drwxr-xr-x. 2 root root 4096 Aug 10 03:14 file
-rw-r--r--. 1 root root 102 Aug 10 20:19 name