Cheatsheet: Ripgrep (rg)
A handy reference for using ripgrep (rg), an extremely fast replacement for grep
About
URL | https://github.com/BurntSushi/ripgrep |
About | An extremely fast replacement for grep |
Flags
Case insensitive search | rg -i TERM |
---|---|
Show NUM lines After match | rg -A NUM TERM |
Show NUM lines Before match | rg -B NUM TERM |
Show NUM lines Context (before + after) | rg -C NUM TERM |
Show only file names | rg -l TERM |
Don't show term (invert) | rg -v TERM |
Don't respect .*ignore files |
rg --no-ignore TERM |
Include hidden (.env, .config/, etc. ) |
rg --hidden TERM |
Search binary files like text | rg --text TERM |
Use multiple paterns | rg -e TERM1 -e TERM2 |
Subscribe to my monthly newsletter
No spam, no sharing to third party. Only you and me.