2025-03-14 21:59:59 -06:00
|
|
|
# rgrep
|
|
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
> Recursively find patterns in files using `regex`.
|
2025-03-14 21:59:59 -06:00
|
|
|
> Equivalent to `grep -r`.
|
2025-04-03 20:36:56 -06:00
|
|
|
> More information: <https://www.gnu.org/software/grep/manual/grep.html#Command_002dline-Options>.
|
2025-03-14 21:59:59 -06: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:
|
|
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`rgrep {{[-i|--ignore-case]}} "{{search_pattern}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
- Recursively search for an extended `regex` pattern (supports `?`, `+`, `{}`, `()` and `|`) in the current working directory:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`rgrep {{[-E|--extended-regexp]}} "{{search_pattern}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-09-14 18:48:49 -06:00
|
|
|
- Recursively search for an exact string (disables `regex`) in the current working directory:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-04-03 20:36:56 -06:00
|
|
|
`rgrep {{[-F|--fixed-strings]}} "{{exact_string}}"`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Recursively search for a pattern in a specified directory (or file):
|
|
|
|
|
|
|
|
|
|
`rgrep "{{search_pattern}}" {{path/to/file_or_directory}}`
|