chore(style): add shebang, set bash strict mode, create function
[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 To update or switch versions, run `webi rg@stable` (or `@v13.0`, `@beta`, etc).
9
10 ## Cheat Sheet
11
12 > Ripgrep (`rg`) is smart. It's like grep if grep were built for code. It
13 > respects `.gitignore` and `.ignore`, has all of the sensible options you want
14 > (colors, numbers, etc) turned on by default, is written in Rust, and typically
15 > outperforms grep in many use cases.
16
17 ```bash
18 rg <search-term> # searches recursively, ignoring .git, node_modules, etc
19 ```
20
21 ```bash
22 rg 'function doStuff'
23 ```
24
25 ```bash
26 rg 'doStuff\(.*\)'
27 ```
28
29 ### Inverse Search
30
31 Use `-v` to filter out all matches so that only non-matches are left.
32
33 ```bash
34 rg 'bar' | rg -v 'foobar'
35 ```
36
37 ### Disable Smart Filtering
38
39 By default `rg` respects `.gitignore`, `.ignore`, `.git/info/exclude` and
40 ignores many types of hidden files, dot files, etc.
41
42 You can use `-uu` to set all of the `--no-ignore-*` options and others.
43
44 ```bash
45 rg -uu 'SECRET='
46 ```