ripgrep fast search

List files containing TODO/FIXME/HACK in Python files

rg 'TODO|FIXME|HACK' --type py -l

tool
grep15 commands
tags
grep

More grep commands

  • rg 'panic' -C3 --glob '*.go'

    3 lines of context around matches in Go files

  • rg 'secret_key' --hidden --no-ignore

    Search hidden and .gitignore'd files

  • rg 'old_value' --replace 'new_value' --passthru config.yaml

    Preview how a replacement would look without writing

  • rg 'error' /var/log/ --stats 2>&1 | tail -5

    Show total matches, files searched, elapsed time

  • grep -a 'password' /proc/<pid>/mem 2>/dev/null | strings | head -20

    Treat binary as text (-a) to search process memory

all 15 grep commands