From e6368a16375f062d3f4f6993b7badd9effb75b2d Mon Sep 17 00:00:00 2001 From: gsspdev Date: Mon, 28 Apr 2025 21:34:56 -0500 Subject: [PATCH] Updated pages/common/rg --- pages/common/rg.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pages/common/rg.md b/pages/common/rg.md index 77354e095a..fa973a6181 100644 --- a/pages/common/rg.md +++ b/pages/common/rg.md @@ -2,36 +2,36 @@ > Ripgrep, a recursive line-oriented search tool. > Aims to be a faster alternative to `grep`. -> More information: . +> More information: . -- Recursively search the current directory for a regular expression: +- Recursively search current directory for a pattern (regular expression): -`rg {{regular_expression}}` +`rg {{pattern}}` -- Search for regular expressions recursively in the current directory, including hidden files and files listed in `.gitignore`: +- Include hidden files and entries listed in `.gitignore`: -`rg --no-ignore --hidden {{regular_expression}}` +`rg {{[-.|--hidden --no-ignore]}} {{pattern}}` -- Search for a regular expression only in a subset of directories: +- Only search a subset of directories: -`rg {{regular_expression}} {{set_of_subdirs}}` +`rg {{pattern}} {{set_of_subdirs}}` -- Search for a regular expression in files matching a glob (e.g. `README.*`): +- Only search the files who's names match the glob pattern(s) (e.g. `README.*`): -`rg {{regular_expression}} --glob {{glob}}` +`rg {{pattern}} {{[-g|--glob]}} {{filename_glob_pattern}}` -- Search for filenames that match a regular expression: +- Recursively list filenames in the current directory that match pattern: -`rg --files | rg {{regular_expression}}` +`rg --files | rg {{pattern}}` - Only list matched files (useful when piping to other commands): -`rg --files-with-matches {{regular_expression}}` +`rg {{[-l|--files-with-matches]}} {{pattern}}` -- Show lines that do not match the given regular expression: +- Show lines that do not match the pattern: -`rg --invert-match {{regular_expression}}` +`rg {{[-v|--invert-match]}} {{pattern}}` - Search a literal string pattern: -`rg --fixed-strings -- {{string}}` +`rg {{[-F|--fixed-strings]}} -- {{string}}`