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 ~]# 
相关推荐
码思途远3 小时前
NXP i.MX8系列平台开发讲解 - 3.18 Linux tty子系统介绍(一)
linux·nxp·i.mx8m
aliceDingYM3 小时前
Linux python3.6安装mayavi报错
linux·python·ui
没耳朵的Rabbit3 小时前
RedHat运维-LinuxSELinux基础3-用布尔值调整SELinux政策
运维·服务器
kinlon.liu3 小时前
Linux的前世今生
linux·运维·服务器
CloudJourney3 小时前
探索 Kali Linux:定义、架构、原理、应用场景及常见命令体系
linux·运维·架构
没耳朵的Rabbit3 小时前
RedHat运维-LinuxSELinux基础1-SELinux三种状态
运维·服务器·网络
搬砖写代码3 小时前
MySQL数据库文件在Linux下存放位置
linux·数据库·mysql
季春二九4 小时前
解决 Docker 容器镜像拉取难题:全面指南
运维·docker·容器
^_^ 纵歌4 小时前
virtualbox和docker的区别和优缺点以及如何选择
运维·docker·容器
运维之美@5 小时前
Linux dig命令常见用法
linux·运维·服务器