# ripgrep (rg)

> A fast command. It looks in every file in a folder for a word or pattern.

**Field:** Software Development  
**Category:** Code Intelligence  
**Also known as:** rg, ripgrep Command, rg Command

## Think of it like

It is like a fast finger. It runs down each page in a folder to find one word.

## Definition

ripgrep is a command-line tool that searches every file in a folder for a word or pattern. You run it as rg. It looks through all the folders inside, too. By default it skips files listed in .gitignore, hidden files and binary files. That makes it fast and its results clean, so many editors and AI tools use it inside.

## Example

Jack types rg parseDate in his project. It prints the three lines that use it, with file names and line numbers.

## Example code

```console
$ rg parseDate
src/orders.ts
14:  const day = parseDate(order.created);
src/reports.ts
8:  return parseDate(row.date);
```

One command finds each line with parseDate, and groups the lines by file.

## Why it matters

It is often the fastest way to find something in code. It runs in under a second on large projects.

## Common mistake

Not finding a file you know is there. It may be in .gitignore or hidden, so add --hidden or --no-ignore.

## Three principles

- **Searches folders.** Every file, every subfolder.
- **Skips the junk.** Ignored, hidden and binary files.
- **Takes patterns.** Words or regular expressions.

## Related terms

- [Code Search](https://learn.benibix.com/term/development/code-search)
- [Regular Expression (Regex)](https://learn.benibix.com/term/development/regular-expression)
- [Grep Tool](https://learn.benibix.com/term/ai/grep-tool)
- [Command Line](https://learn.benibix.com/term/infrastructure/command-line)
- [Sourcegraph](https://learn.benibix.com/term/development/sourcegraph)

![Two search boxes side by side. On the left, text search: the command rg parseDate returns three lines that contain that exact word, with file names and line numbers. On the right, semantic code search, lit up: the question where do we check passwords returns a function called verifyLogin, which never uses the word password in its name. Below, a wide bar shows search running across many repositories at once.](https://learn.benibix.com/diagrams/dev4-code-search.svg)

---

Source: https://learn.benibix.com/term/development/ripgrep
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
