614e326ecac034faab8802843079277eb519a08f
[webi-installers/.git] / rg / README.md
1 ---
2 title: Ripgrep
3 homepage: https://github.com/BurntSushi/ripgrep
4 tagline: |
5   Ripgrep is a git and sourcecode-aware drop-in grep replacement.
6 ---
7
8 ## Updating `rg`
9
10 ```bash
11 webi rg@stable
12 ```
13
14 Use the `@beta` tag for pre-releases.
15
16 ## Cheat Sheet
17
18 > Ripgrep (`rg`) is smart. It's like grep if grep were built for code. It
19 > respects `.gitignore` and `.ignore`, has all of the sensible options you want
20 > (colors, numbers, etc) turned on by default, is written in Rust, and typically
21 > outperforms grep in many use cases.
22
23 ```bash
24 rg <search-term> # searches recursively, ignoring .git, node_modules, etc
25 ```
26
27 ```bash
28 rg 'function doStuff'
29 ```
30
31 ```bash
32 rg 'doStuff\(.*\)'
33 ```
34
35 ### Inverse Search
36
37 Use `-v` to filter out all matches so that only non-matches are left.
38
39 ```bash
40 rg 'bar' | rg -v 'foobar'
41 ```
42
43 ### Disable Smart Filtering
44
45 By default `rg` respects `.gitignore`, `.ignore`, `.git/info/exclude` and
46 ignores many types of hidden files, dot files, etc.
47
48 You can use `-uu` to set all of the `--no-ignore-*` options and others.
49
50 ```bash
51 rg -uu 'SECRET='
52 ```