加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

[Bash] Search for Text with `grep`

发布时间:2020-12-15 23:22:21 所属栏目:安全 来源:网络整理
导读:In this lesson,we’ll use? grep ?to find text patterns. We’ll also go over some of the flags that? grep ?has that can be combined together to make it more powerful and easier to read. ? grep --color -n -C 5 " npm.config.get " lib /**/ * .

In this lesson,we’ll use?grep?to find text patterns. We’ll also go over some of the flags that?grep?has that can be combined together to make it more powerful and easier to read.

?

grep --color -n -C 5 "npm.config.get" lib/**/*.js

# --color: highlight
# -n: show line number
# -C 5: show 5 lines for each context
# search for content "npm.config.get"
# in lib folder for every matching js files

?

Can also using ‘-e‘ for regex partten.

?

Using `man grep` for help

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读