Skip to content

ripgrep🔗

Back

A faster, modern alternative to grep

Installation🔗

sudo apt install ripgrep
# brew install ripgrep

Basic Usage🔗

  1. Search in Files

    rg "pattern"
    
  2. Case-Insensitive Search

    rg -i "pattern"
    
  3. Search in Specific File Types

    rg "pattern" -t py
    
  4. Exclude Files/Directories

    rg "pattern" --glob '!node_modules'
    
  5. JSON Output

    rg "pattern" --json
    
  6. Replace Text

    rg "old" --replace "new"
    

Combining rg with fzf🔗

rg "pattern" | fzf