摘要: 正则表达式,也叫规则表达式 通过规则表达式找到我们想要的东西 ^ 锚定行首[root@tz shell]# cat regex hello world hi hello hello ,zsy [root@tz shell]# grep "^hello" regex hello world hello 阅读全文
posted @ 2020-05-03 23:28 努力吧阿团 阅读(154) 评论(0) 推荐(0) 编辑
摘要: grep是一个可以利用正则表达式进行全局搜索的工具,区分大小写。 参数介绍 -n 打印行号 -i 不区分大小写 --color 高亮显示 -c 符合条件的总行数 -o 只显示匹配到的关键字,不打印整行,会把每一个匹配到的关键字都单独显示在一行中 -B1 显示符合条件的行同时还显示之前的1行,befo 阅读全文
posted @ 2020-05-03 20:20 努力吧阿团 阅读(168) 评论(0) 推荐(0) 编辑