Linux三剑客之grep用法----查看去除注释和空行的文档

使用grep 带Ev参数,个人对于理解就是,E参数表示可以使用正则表达式,v参数表示反转正则表达式的匹配,此参数的官方解释如下

 -E, --extended-regexp
              Interpret PATTERN as an extended regular expression (see below).
              将模式解释为扩展的正则表达式(参见下面)。

 -e PATTERN, --regexp=PATTERN
              Use PATTERN as the pattern; useful to protect patterns beginning
              with -.
              使用模式作为模式;有用的保护模式开始

-V, --version
              Print  the  version number of grep to standard error.  This ver-
              sion number should be included in all bug reports (see below).
              将grep的版本号打印到标准错误。这版本所有的bug报告中都应该包含sion号(见下面)。
-v, --invert-match
              Invert the sense of matching, to select non-matching lines.
              反转匹配的意义,来选择不匹配的行。

[ops@VM217 etc]$ cat zabbix_server.conf | grep -Ev '#|^$' 结果如下

[ops@VM217 etc]$ cat zabbix_server.conf | grep -Ev '#|^$'
LogFile=/tmp/zabbix_server.log
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix@ruifu123
DBSocket=/data/mysql/run/mysql.sock
StartPollers=500
StartIPMIPollers=30
StartPollersUnreachable=50
StartTrappers=30
StartDiscoverers=6
HousekeepingFrequency=12
MaxHousekeeperDelete=1000000
CacheSize=2G
StartDBSyncers=20
HistoryCacheSize=512M
HistoryIndexCacheSize=128M
TrendCacheSize=256M
ValueCacheSize=512M
Timeout=30
AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts
FpingLocation=/usr/local/fping/sbin/fping
LogSlowQueries=3000
StartProxyPollers=20
ProxyConfigFrequency=30
ProxyDataFrequency=1
User=daemon

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

hobby云说

你的鼓励将是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值