From 0deecf1264ebb35c692e19966c3349908a9511a3 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 11 Nov 2020 20:01:09 -0700 Subject: [PATCH] add rg options -uu and -v --- rg/README.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/rg/README.md b/rg/README.md index d161670..614e326 100644 --- a/rg/README.md +++ b/rg/README.md @@ -16,9 +16,9 @@ Use the `@beta` tag for pre-releases. ## Cheat Sheet > Ripgrep (`rg`) is smart. It's like grep if grep were built for code. It -> respects `.gitignore` and `.ignore`, has all of the sensible options you -> want (colors, numbers, etc) turned on by default, is written in Rust, and -> typically outperforms grep in many use cases. +> respects `.gitignore` and `.ignore`, has all of the sensible options you want +> (colors, numbers, etc) turned on by default, is written in Rust, and typically +> outperforms grep in many use cases. ```bash rg # searches recursively, ignoring .git, node_modules, etc @@ -31,3 +31,22 @@ rg 'function doStuff' ```bash rg 'doStuff\(.*\)' ``` + +### Inverse Search + +Use `-v` to filter out all matches so that only non-matches are left. + +```bash +rg 'bar' | rg -v 'foobar' +``` + +### Disable Smart Filtering + +By default `rg` respects `.gitignore`, `.ignore`, `.git/info/exclude` and +ignores many types of hidden files, dot files, etc. + +You can use `-uu` to set all of the `--no-ignore-*` options and others. + +```bash +rg -uu 'SECRET=' +``` -- 2.25.1