前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >小知识:grep过滤以#号开头的注释行 和 空行

小知识:grep过滤以#号开头的注释行 和 空行

作者头像
Alfred Zhao
发布2023-10-10 18:09:09
5270
发布2023-10-10 18:09:09
举报

xtts的配置文件,有很多注释不想直接去掉的情况下,想清楚的看到目前设置了哪些参数,可以用grep过滤查看: grep -vE '^#|^$' xtt.properties

效果如下:

代码语言:javascript
复制
[oracle@db11gcas xtt]$ grep -vE '^#|^$' xtt.properties
tablespaces=DBS_D_JINGYU, DBS_I_JINGYU
platformid=13
src_scratch_location=/u01/media/src_backups/
dest_datafile_location=+DATADG
dest_scratch_location=/xtts/
parallel=3
rollparallel=2
getfileparallel=4
destconnstr=sys/oracle@jingyu
allowstandby=1

简单来说,E是正则,v是反向匹配,^$ 是空行,^#是#开头的:

-E, --extended-regexp Interpret PATTERN as an extended regular expression (ERE, see below). (-E is specified by POSIX.) -v, --invert-match Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.) Anchoring The caret ^ and the dollar sign $ are meta-characters that respectively match the empty string at the beginning and end of a line.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2023-06-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档