# ripgrep | Andrew Gallant | Knowledge Base | Instagit

ripgrep recursively searches directories for a regex pattern while respecting your gitignore

GitHub Stars: 60.6k

Repository: https://github.com/BurntSushi/ripgrep

---

## Articles

### [How ripgrep's `--quit-after-match` Flag Improves Search Performance](/BurntSushi/ripgrep/how-does-ripgrep-quit-after-match-option-affect-performance)

Learn how ripgrep's --quit-after-match flag boosts search performance by stopping instantly after the first match, reducing I/O and CPU usage for faster results.

- Tags: performance
- Published: 2026-03-05

### [How to Use `--pre` and `--preproc` Flags for Custom Input Filtering in ripgrep](/BurntSushi/ripgrep/how-do-i-use-pre-and-preproc-flags-for-custom-input-filtering)

Learn to use ripgrep's --pre flag for custom input filtering. Execute external preprocessors on files before searching for powerful text manipulation.

- Tags: how-to-guide
- Published: 2026-03-05

### [How Ripgrep Memory-Mapped File Search Differs From Buffered Search](/BurntSushi/ripgrep/how-does-ripgrep-memory-mapped-file-search-differ-from-buffered-search)

Discover how ripgrep's memory-mapped file search uses zero-copy views while buffered search uses an 8 KB LineBuffer to optimize file content searching across platforms.

- Tags: internals
- Published: 2026-03-05

### [How to Sort ripgrep Search Results by Path, Modified Time, or Match Count](/BurntSushi/ripgrep/how-do-i-sort-search-results-by-path-modified-time-or-count)

Learn how to sort ripgrep search results by path, modified time, or match count using the --sort flag and external utilities for efficient file searching.

- Tags: how-to-guide
- Published: 2026-03-05

### [How ripgrep Handles Symbolic Links During Directory Traversal](/BurntSushi/ripgrep/how-does-ripgrep-handle-symbolic-links-during-traversal)

Discover how ripgrep handles symbolic links during directory traversal. Learn about its ignore crate integration, symlink detection, follow flag, and cycle prevention for efficient searching.

- Tags: internals
- Published: 2026-03-05

### [How to Debug Why ripgrep Is Skipping Certain Files: A Complete Guide to Ignore Logic](/BurntSushi/ripgrep/how-do-i-debug-why-ripgrep-is-skipping-certain-files)

Debug ripgrep file skipping with the --debug flag. See ignore rule matches, size limits, binary detection, and permission errors in real-time.

- Tags: how-to-guide
- Published: 2026-03-05

### [How to Set Up ripgrep Shell Completions for Bash, Zsh, and Fish](/BurntSushi/ripgrep/how-do-i-set-up-shell-completions-for-bash-zsh-or-fish)

Easily set up ripgrep shell completions for Bash, Zsh, and Fish. Run rg --generate followed by your shell to install custom completion scripts and boost your productivity.

- Tags: how-to-guide
- Published: 2026-03-05

### [How to Use ripgrep with Vim for Seamless Search Navigation](/BurntSushi/ripgrep/how-does-ripgrep-integrate-with-vim-for-search-navigation)

Learn how ripgrep integrates seamlessly with Vim using the --vimgrep flag for efficient search navigation directly in Vim's quickfix list.

- Tags: tutorial
- Published: 2026-03-05

### [How to Use ripgrep JSON Output Format for Programmatic Parsing](/BurntSushi/ripgrep/how-do-i-use-ripgrep-json-output-format-for-programmatic-parsing)

Learn to programmatically parse ripgrep search results using its JSON output format. Avoid brittle text scraping with structured JSON records for robust analysis.

- Tags: how-to-guide
- Published: 2026-03-05

### [How to Create Custom File Type Definitions with Glob Patterns in ripgrep](/BurntSushi/ripgrep/how-do-i-create-custom-file-type-definitions-with-glob-patterns)

Learn to add custom file types to ripgrep using glob patterns. Define them per-invocation with --type-add or persist them in a config file for efficient searching.

- Tags: how-to-guide
- Published: 2026-03-05

### [How ripgrep Detects and Handles Binary Files: LineBuffer and BinaryDetection Explained](/BurntSushi/ripgrep/how-does-ripgrep-detect-and-handle-binary-files)

Learn how ripgrep detects binary files using LineBuffer and BinaryDetection. Discover configuration options to manage binary file searching effectively.

- Tags: internals
- Published: 2026-03-05

### [How to Configure ripgrep to Search Hidden Files and Directories](/BurntSushi/ripgrep/how-do-i-configure-ripgrep-to-search-hidden-files-and-directories)

Learn how to configure ripgrep to search hidden files and directories using the powerful --hidden flag. Discover ripgrep's default behavior and override it with this simple solution.

- Tags: how-to-guide
- Published: 2026-03-05

### [How to Search for Non-UTF-8 Encoded Files with ripgrep: Latin-1, GBK, and More](/BurntSushi/ripgrep/how-do-i-search-for-non-utf8-encoded-files-utf16-latin1-gbk)

Learn to search non UTF-8 encoded files like Latin-1 and GBK with ripgrep. Master RFC 1345, GBK, and raw byte searches with the -E flag.

- Tags: how-to-guide
- Published: 2026-03-05

### [How to Search Compressed Files with ripgrep: Gzip, Bzip2, XZ and More](/BurntSushi/ripgrep/how-do-i-search-files-compressed-in-gzip-bzip2-xz-or-other-formats)

Effortlessly search gzip bzip2 xz and other compressed files with ripgrep. Use the -z flag to search inside archives without manual decompression.

- Tags: how-to-guide
- Published: 2026-03-05

### [How ripgrep's Replacement Feature Works: A Deep Dive into --replace](/BurntSushi/ripgrep/how-does-ripgrep-replacement-or-substitution-feature-work)

Explore ripgrep's --replace flag for efficient display-only text substitution and capture group interpolation. Learn how ripgrep enhances search without altering files.

- Tags: deep-dive
- Published: 2026-03-05

### [How to Search for Patterns That Span Multiple Lines in ripgrep](/BurntSushi/ripgrep/how-do-i-search-for-patterns-that-span-multiple-lines-in-ripgrep)

Learn how to search for patterns that span multiple lines in ripgrep using the -U or --multiline flag. Master advanced regex matching across newlines efficiently.

- Tags: how-to-guide
- Published: 2026-03-05

### [How ripgrep Ignore Precedence Rules Work: .gitignore vs .ignore vs .rgignore](/BurntSushi/ripgrep/how-do-ripgrep-ignore-precedence-rules-work-gitignore-vs-ignore-vs-rgignore)

Understand ripgrep ignore precedence: command line, .rgignore, .ignore, and .gitignore. Learn how deeper directory rules win to optimize your searches.

- Tags: internals
- Published: 2026-03-05

### [Why Does a Leading Slash in Patterns Fail on Windows in ripgrep?](/BurntSushi/ripgrep/why-does-using-a-leading-slash-in-patterns-fail-on-windows)

Discover why leading slashes in ripgrep patterns fail on Windows. Learn how Cygwin and MSYS path conversion prevents your patterns from working as expected.

- Tags: internals
- Published: 2026-03-05

### [Ripgrep Regex Size Limit: How to Fix the 100 MiB Compilation Error](/BurntSushi/ripgrep/whats-the-regex-size-limit-in-ripgrep-and-how-do-i-work-around-it)

Encounter the ripgrep regex size limit 100 MiB error? Learn how to fix this compilation issue by overriding the limit or switching to the PCRE2 engine.

- Tags: internals
- Published: 2026-03-05

### [How ripgrep Efficiently Applies Multiple Gitignore Glob Patterns](/BurntSushi/ripgrep/how-does-ripgrep-efficiently-apply-multiple-gitignore-glob-patterns)

Discover how ripgrep efficiently applies multiple gitignore glob patterns by compiling them into a single automaton for O(1) average time path matching with easy precedence rule resolution.

- Tags: internals
- Published: 2026-03-05

### [How ripgrep's Parallel Directory Traversal Works: A Technical Deep Dive](/BurntSushi/ripgrep/how-does-ripgrep-parallel-directory-traversal-work-internally)

Discover how ripgrep achieves efficient parallel directory traversal with its custom WorkParallel iterator and work-stealing deque for balanced load handling. Optimize your searches now.

- Tags: deep-dive
- Published: 2026-03-05

