Skip to main content

Menu

LEVEL 0
0/5 XP
HomeAboutTopicsPricingMy VaultStats

Categories

🤖 Artificial Intelligence
☁️ Cloud and Infrastructure
💾 Data and Databases
💼 Professional Skills
🎯 Programming and Development
🔒 Security and Networking
📚 Specialized Topics
HomeAboutTopicsPricingMy VaultStats
LEVEL 0
0/5 XP
GitHub
© 2026 CheatGrid™. All rights reserved.
Privacy PolicyTerms of UseAboutContact

ripgrep Code Search Cheat Sheet

ripgrep Code Search Cheat Sheet

Back to Operating Systems and CLI
Updated 2026-05-21
Next Topic: rsync File Synchronization and Backup Cheat Sheet

ripgrep (rg) is a line-oriented, recursive search tool written in Rust that searches directories for regex patterns at speeds typically 5–13× faster than GNU grep. It powers the search in Visual Studio Code, Neovim/fzf integrations, and AI coding agents like Claude Code and Cursor. The key mental model: ripgrep's defaults are smart — it automatically respects .gitignore, skips hidden files and binary files, runs multi-threaded, and uses SIMD-accelerated regex matching, meaning you get the right results without extra flags in nearly every codebase scenario.

What This Cheat Sheet Covers

This topic spans 21 focused tables and 129 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.

Table 1: Basic Pattern SearchTable 2: Case SensitivityTable 3: Fixed-String and Word-Boundary SearchTable 4: File Type FilteringTable 5: Glob Include and ExcludeTable 6: Automatic Filtering and Ignore BehaviorTable 7: Output FormattingTable 8: Context LinesTable 9: Replace and SubstitutionTable 10: Count and Stats ModesTable 11: Sorting and ThreadingTable 12: Multiline SearchTable 13: PCRE2 Mode (Advanced Regex)Table 14: JSON Output for Tooling IntegrationTable 15: Multiple Pattern and Pattern-File SearchTable 16: Traversal and Search-Scope OptionsTable 17: Configuration FileTable 18: Editor and Tool IntegrationTable 19: Comparison with grep, ag, and ackTable 20: Performance Characteristics and TipsTable 21: Common Real-World Search Patterns

Table 1: Basic Pattern Search

The simplest and most common ripgrep invocations — search a pattern across the current directory or a specific path. By default the pattern is a regex, output is grouped by filename, line numbers are shown, and matches are colored.

CommandExampleDescription
basic search
rg 'TODO'
• Recursively searches the current directory for the pattern
• equivalent to rg 'TODO' ./.
search in path
rg 'TODO' src/
Limits the search to the given directory or file path.
regex pattern
rg 'fn write\('
Default mode treats the pattern as a Rust regex (finite-automata, linear time, Unicode-aware).

More in Operating Systems and CLI

  • Operating System Fundamentals Cheat Sheet
  • rsync File Synchronization and Backup Cheat Sheet
  • AWS CLI Cheat Sheet
  • GCP CLI Cheat Sheet
  • Linux Text Processing with grep, sed, and awk Cheat Sheet
  • systemd and Linux Service Management Cheat Sheet
View all 48 topics in Operating Systems and CLI