1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/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

32 lines
727 B
Markdown

# ag
> The Silver Searcher. Like `ack`, but aims to be faster.
> More information: <https://github.com/ggreer/the_silver_searcher>.
- Find files containing "foo", and print the line matches in context:
`ag {{foo}}`
- Find files containing "foo" in a specific directory:
`ag {{foo}} {{path/to/directory}}`
- Find files containing "foo", but only list the filenames:
`ag -l {{foo}}`
- Find files containing "FOO" case-insensitively, and print only the match, rather than the whole line:
`ag -i -o {{FOO}}`
- Find "foo" in files with a name matching "bar":
`ag {{foo}} -G {{bar}}`
- Find files whose contents match a regular expression:
`ag '{{^ba(r|z)$}}'`
- Find files with a name matching "foo":
`ag -g {{foo}}`