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 ~]# 
相关推荐
咋吃都不胖lyh1 小时前
linux环境在vscode链接到一个git仓库,克隆和拉取详细命令行
linux·git·vscode
小小小米粒3 小时前
NAT 模式, 仅主机模式 Host-Only ,桥接模式 Bridge
linux·服务器·网络
梦白.5 小时前
Python的容器类型
运维·python
沙漏无语7 小时前
(二)TIDB搭建正式集群
linux·数据库·tidb
tuotali20267 小时前
天然气压缩机技术2026,高可靠性长周期运行与智能运维融合路径
运维·python
思麟呀7 小时前
计算机网络初步认识
linux·计算机网络
姚不倒7 小时前
三节点 TiDB 集群部署与负载均衡搭建实战
运维·数据库·分布式·负载均衡·tidb
gpio_017 小时前
自建gitlab服务器并用sakurafrp穿透
运维·服务器·gitlab
k7Cx7e7 小时前
Debian执行ssh root@localhost 提示认证失败
运维·debian·ssh