linux扩展正则表达式之+

1.+含义

linux扩展正则表达式+表示重复"一个或一个以上"的字符。

2.样例

命令:

grep -En "bo+t" anaconda-ks.cfg

OR

egrep -n "bo+t" anaconda-ks.cfg

#搜索含有(bot)、(boot)、(booot)等字符串的行,o+表示"一个以上的o"。

复制代码
[root@elasticsearch ~]# grep -En "bo+t" 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 ~]# 
[root@elasticsearch ~]# egrep -n "bo+t" 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 ~]# 
相关推荐
Antonio9151 小时前
【Linux】 Linux 进程控制
linux·运维·服务器
thinkMoreAndDoMore1 小时前
linux驱动开发(1)-内核模块
linux·运维·驱动开发
darin_ฅ( ̳• ◡ • ̳)ฅ11 小时前
Linux环境-通过命令查看zookeeper注册的服务
linux·zookeeper
不想头秃a2 小时前
JavaEE初阶-网络编程
java·运维·服务器·网络
一ge科研小菜鸡2 小时前
云原生 DevOps 实践路线:构建敏捷、高效、可观测的交付体系
运维·云原生·devops
Chuncheng's blog2 小时前
CentOS 7 如何pip3安装pyaudio?
linux·运维·python·centos
西阳未落2 小时前
Linux(12)——基础IO(下)
linux·运维·服务器
什么半岛铁盒2 小时前
云服务器Xshell登录拒绝访问排查
运维·服务器
cido2 小时前
kali在apt update报错提示没有公钥
linux·apt·kali
wqqqianqian3 小时前
国产linux系统(银河麒麟,统信uos)使用 PageOffice在线编辑word文件保存数据同时保存文件
linux·word·信创·国产·保存·pageoffice·在线编辑