-u, --unrestricted
This flag reduces the level of "smart" filtering. Repeated uses (up to 3) reduces the filtering even more. When repeated three times, ripgrep will search every file in a directory tree.
A single -u/--unrestricted flag is equivalent to --no-ignore. Two -u/--unrestricted flags is equivalent to --no-ignore -./--hidden. Three -u/--unrestricted flags is equivalent to --no-ignore -./--hidden --binary.
The only filtering ripgrep still does when -uuu is given is to skip symbolic links and to avoid printing matches from binary files. Symbolic links can be followed via the -L/--follow flag, and binary files can be treated as text files via the -a/--text flag.
核心含义拆解
1. 总体概念
This flag reduces the level of "smart" filtering. Repeated uses (up to 3) reduces the filtering even more. 意思:这个标志降低了'智能'过滤的级别。重复使用它(最多 3 次)会进一步减少过滤。
2. 三个级别的具体定义
文档明确列出了 -u 叠加三次的等价效果:
-
-u (输入一次)
- 原文:
equivalent to --no-ignore - 意思:不再理会忽略规则。即使写在
.gitignore或.ignore里的文件,也会被搜索。 - *场景:你想搜
node_modules或构建目录里的代码。
- 原文:
-
-uu (输入两次)
- 原文:
equivalent to --no-ignore -./--hidden - 意思:包含隐藏文件。除了忽略
.gitignore,还会搜索以 开头的文件(如 , )。
- 原文:

