Search fast with ripgrep

List Python files that contain TODO, FIXME or HACK

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

tool
grep15 commands
tags
grep

More grep commands

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

    Show 3 lines of context around matches in Go files

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

    Also search hidden files and files ignored by .gitignore

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

    Show the whole file with the replacement applied, without writing to it

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

    Show the number of matches, searched files and elapsed time

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

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

all 15 grep commands