We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 55b78db commit db61875Copy full SHA for db61875
1 file changed
docs/Ch06/index.md
@@ -279,6 +279,23 @@ $ grep -R 'hello' . # 递归查找当前目录下内容包含 hello 的文件
279
280
grep 事实上是非常强大的查找工具,[第九章](../Ch09/index.md)将在介绍正则表达式语法之后进一步介绍 grep。
281
282
+!!! tip "ripgrep"
283
+
284
+ 除了 grep 以外,还有一个更快更强大的工具 [ripgrep](https://github.com/BurntSushi/ripgrep)。其会默认递归查找当前目录下的文件。安装 `ripgrep` 包后使用 `rg` 命令,即可作为 `grep -R` 的替代:
285
286
+ ```console
287
+ $ # 在 /etc/ 下搜索包含 localhost 的文件
288
+ $ rg localhost /etc/
289
+ /etc/hosts
290
+ 1:127.0.0.1 localhost
291
+ 2:::1 localhost
292
293
+ /etc/security/pam_env.conf
294
+ 52:# to "localhost" rather than not being set at all
295
+ 53:#REMOTEHOST DEFAULT=localhost OVERRIDE=@{PAM_RHOST}
296
+ 64:#NNTPSERVER DEFAULT=localhost
297
+ ```
298
299
### 文本替换:sed {#sed}
300
301
`sed` 命令可以替换文本中的字符串:
0 commit comments