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 ~]#
文章详细解释了如何在Linux中使用`grep-E`和`egrep-n`命令结合扩展正则表达式搜索boot或booot字符串在Anaconda-ks.cfg文件中的出现情况,展示了系统引导加载器配置部分。
978

被折叠的 条评论
为什么被折叠?



