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 ~]# 
相关推荐
Vect__2 分钟前
深刻理解虚拟内存机制
linux
maosheng11468 分钟前
Linux的第二次作业
linux·运维·服务器
maosheng11469 分钟前
Linux
linux·运维·服务器
sR916Mecz1 小时前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
java·linux·服务器
扑火的小飞蛾1 小时前
Windows 10 与 Kali Linux SSH 免密互信配置指南
linux·windows·ssh
0xDevNull1 小时前
Linux服务器日志查看完全指南
linux·运维·服务器
songx_991 小时前
Linux基础1
linux·运维·服务器
蓝天居士1 小时前
cpio命令详解(3)
linux·cpio
菱玖2 小时前
Linux 系统性能排查常用指令
linux·运维·服务器
huangwxiao2 小时前
HTB——Oopsie
linux·网络安全·htb