Files
tldr/pages.zh/common/ag.md
Reinhart Previano Koentjoro d6d4561c17 pages*: fix documentation mistakes (#11641)
* a2ping: minor fixes

* ab: fix mnemonics

* ab: fix mnemonics

* ab: fix mnemonics

* abduco: add mnemonics

* accelerate: use Hugging Face as a trademark

* ack: highlight grep as a command

* acme.sh: highlight certbot as command

* act: add mnemonics

* ag: highlight ack as command

* age-keygen: add Oxford comma

* linux/shutdown: add mnemonics

* airdecap-ng: use Oxford comma

* alex: use standard path name template
2023-12-03 19:59:57 +07:00

33 lines
745 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ag
> The Silver Searcher. 类似 `ack`, 但是更快。
> 更多信息:<https://github.com/ggreer/the_silver_searcher>.
- 寻找内容包含"小明"的文件,并列出所在的行数:
`ag {{小明}}`
- 在指定目录中寻找内容包含 "foo" 的文件:
`ag {{小明}} {{指定的目录}}`
- 寻找内容包含 "foo" 的文件,但只列出文件名:
`ag -l {{小明}}`
- 忽略大小写,寻找内容包含 "ABC" 的文件,并只输出匹配的内容,而非整行:
`ag -i -o {{ABC}}`
- 在文件名包含"小红"的文件中寻找"小明"
`ag {{小明}} -G {{小红}}`
- 使用正则表达式来匹配文件内容:
`ag '{{^ba(r|z)$}}'`
- 输出文件名包含"小明"的文件名:
`ag -g {{小明}}`