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 ~]# 
相关推荐
代码熬夜敲Q24 分钟前
ENSP 网络工程实验
linux·运维·服务器
銳昊城30 分钟前
项目七: 配置与管理Web服务器(2) C2
运维·服务器
Muyuan199834 分钟前
30.通过Claude code做项目系统测试
运维·服务器·人工智能·fastapi
yyuuuzz37 分钟前
aws的核心概念与常见使用场景
运维·服务器·网络·云计算·aws
csdn_life181 小时前
OpenClaw v2026.5.12+ 高级密钥管理:使用SecretRef实现真正的隐蔽存储
linux·openclaw
Terrence Shen1 小时前
Claude Code Harness 源码学习讲义
linux·学习·ubuntu
KivenMitnick1 小时前
LovelyERes:AWD适用的蓝队综合工具
运维·安全·网络安全
赵药师1 小时前
dpkg: warning: files list file for package ‘libselinux1:amd64‘ missing;
linux·运维·服务器
zt1985q1 小时前
本地部署开源内容管理系统 Typemill 并实现外部访问
运维·服务器·开源
ElevenS_it1881 小时前
网络没完全断但业务已经受影响:「灰色故障」排查的完整方法论
运维·服务器·网络