linux扩展正则表达式之?

1.?含义

linux扩展正则表达式?表示“0个或1个”字符

2.样例

命令:

grep -En "boo?t" anaconda-ks.cfg 

OR

egrep -n "boo?t" anaconda-ks.cfg

#搜索(boot)、(booot)这两个字符串。其中,o?代表“0个或1个o”。

[root@elasticsearch ~]# grep -En "boo?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 ~]# egrep -n "boo?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 ~]# 

相关推荐

  1. linux扩展表达式+

    2024-04-04 09:32:02       38 阅读
  2. linux扩展表达式?

    2024-04-04 09:32:02       39 阅读
  3. linux扩展表达式()

    2024-04-04 09:32:02       41 阅读
  4. linux表达式^

    2024-04-04 09:32:02       56 阅读
  5. linux表达式*

    2024-04-04 09:32:02       38 阅读
  6. linux表达式\{n,m\}

    2024-04-04 09:32:02       52 阅读
  7. linux 脚本 表达式

    2024-04-04 09:32:02       57 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-04 09:32:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-04 09:32:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-04 09:32:02       82 阅读
  4. Python语言-面向对象

    2024-04-04 09:32:02       91 阅读

热门阅读

  1. Spring缓存

    2024-04-04 09:32:02       30 阅读
  2. JVM总结

    JVM总结

    2024-04-04 09:32:02      30 阅读
  3. 数据库索引的原理

    2024-04-04 09:32:02       32 阅读
  4. 【C++】每日一题 88 合并两个有序数组

    2024-04-04 09:32:02       34 阅读
  5. GRU&LSTM

    2024-04-04 09:32:02       28 阅读
  6. EKO / 砍树

    2024-04-04 09:32:02       30 阅读
  7. c 储存类

    2024-04-04 09:32:02       35 阅读
  8. @Builder 函数无法被刷新 UI?????

    2024-04-04 09:32:02       30 阅读