当前位置: 首页>前端>正文

linux扩展正则表达式|

1.|含义

linux扩展正则表达式|表示用或(or)的方式找出匹配的字符串

2.样例

命令:

grep -En "boot|booot" anaconda-ks.cfg

OR

egrep -n "boot|booot" anaconda-ks.cfg

#搜索boot或booot这两个字符串的行

[root@elasticsearch ~]# grep -En "boot|booot" anaconda-ks.cfg 
8:# Run the Setup Agent on first boot
9:firstboot --enable
17:network  --bootproto=static --device=ens32 --gateway=172.20.10.1 --ip=172.20.10.11 --nameserver=172.20.10.1 --netmask=255.255.255.240 --ipv6=auto --activate
26:# System bootloader configuration
27:bootloader --location=mbr --boot-drive=sda
28:bootloader --location=mbr --boot-drive=sda
29:boootloader --location=mbr --boot-drive=sda
30:booootloader --location=mbr --boot-drive=sda
[root@elasticsearch ~]# egrep -n "boot|booot" anaconda-ks.cfg 
8:# Run the Setup Agent on first boot
9:firstboot --enable
17:network  --bootproto=static --device=ens32 --gateway=172.20.10.1 --ip=172.20.10.11 --nameserver=172.20.10.1 --netmask=255.255.255.240 --ipv6=auto --activate
26:# System bootloader configuration
27:bootloader --location=mbr --boot-drive=sda
28:bootloader --location=mbr --boot-drive=sda
29:boootloader --location=mbr --boot-drive=sda
30:booootloader --location=mbr --boot-drive=sda
[root@elasticsearch ~]#

https://www.xamrdz.com/web/2bv1961639.html

相关文章: