Skip to content

Quiz: ripgrep (rg)

← Back to quiz index

2 questions

L0 (1 questions)

1. How do you search for a pattern in only Python files, excluding tests?

Show answer rg 'pattern' -t py -g '!test*' or rg 'pattern' --type py --glob '!*test*'

L1 (1 questions)

1. How does ripgrep handle binary files, symlinks, and .gitignore compared to grep?

Show answer rg skips binary files by default (override with -a or --binary). It respects .gitignore, .rgignore, and .ignore files. Symlinks are not followed by default (use -L/--follow). grep searches everything, follows no ignore files, and includes binary matches. rg uses -g/--glob for include/exclude patterns: rg pattern -g '*.py' -g '!test*'.