🕸️ripgrep (rg)
Also known as rg, ripgrep Command, rg Command
A fast command. It looks in every file in a folder for a word or pattern.
Think of it like
It is like a fast finger. It runs down each page in a folder to find one word.
Example
Jack types rg parseDate in his project. It prints the three lines that use it, with file names and line numbers.
Why it matters
It is often the fastest way to find something in code. It runs in under a second on large projects.
Definition
Example code
console
$ rg parseDate
src/orders.ts
14: const day = parseDate(order.created);
src/reports.ts
8: return parseDate(row.date);Common mistake
Key takeaways
- 1Searches folders. Every file, every subfolder.
- 2Skips the junk. Ignored, hidden and binary files.
- 3Takes patterns. Words or regular expressions.