1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-11 20:55:47 +02:00
tldr/pages/common/rgrep.md

26 lines
892 B
Markdown
Raw Normal View History

2021-10-17 15:35:05 -04:00
# rgrep
> Recursively find patterns in files using `regex`.
2021-10-17 15:35:05 -04:00
> Equivalent to `grep -r`.
> More information: <https://www.gnu.org/software/grep/manual/grep.html#Command_002dline-Options>.
2021-10-17 15:35:05 -04:00
- Recursively search for a pattern in the current working directory:
`rgrep "{{search_pattern}}"`
- Recursively search for a case-insensitive pattern in the current working directory:
`rgrep {{[-i|--ignore-case]}} "{{search_pattern}}"`
2021-10-17 15:35:05 -04:00
- Recursively search for an extended `regex` pattern (supports `?`, `+`, `{}`, `()` and `|`) in the current working directory:
2021-10-17 15:35:05 -04:00
`rgrep {{[-E|--extended-regexp]}} "{{search_pattern}}"`
2021-10-17 15:35:05 -04:00
- Recursively search for an exact string (disables `regex`) in the current working directory:
2021-10-17 15:35:05 -04:00
`rgrep {{[-F|--fixed-strings]}} "{{exact_string}}"`
2021-10-17 15:35:05 -04:00
- Recursively search for a pattern in a specified directory (or file):
`rgrep "{{search_pattern}}" {{path/to/file_or_directory}}`