Skip to main content

ripgrep

Fast, recursive search tool for pattern matching in files with regex support, ignore handling, and glob filtering. Use when searching codebases for patterns, finding function definitions, filtering by file type, or performing find/replace operations. Triggers: "search for X in files", "find all occurrences of Y", "grep with glob patterns", "recursive search", "find using regex".

설치로 이동

소스 정보

저장소
jr2804/prompts
최근 소스 활동
2026년 7월 30일 14:25
감지된 SKILL.md 언어
영어
스타
0
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
ripgrep
description
Fast, recursive search tool for pattern matching in files with regex support, ignore handling, and glob filtering. Use when searching codebases for patterns, finding function definitions, filtering by file type, or performing find/replace operations. Triggers: "search for X in files", "find all occurrences of Y", "grep with glob patterns", "recursive search", "find using regex".
# ripgrep (rg) Fast recursive search tool that searches files line-by-line for patterns. ## Basic Usage ```bash rg <pattern> [path] # Recursive search (default) rg -F <literal> [path] # Fixed string (no regex) rg 'pattern' -g '*.rs' # With glob filter ``` ## Key Features ### Automatic Filtering (Default) - Ignores `.gitignore`, `.ignore`, `.rgignore` patterns - Skips hidden files/directories - Skips binary files (files with NUL bytes) - Doesn't follow symlinks Override with: ```bash --no-ignore # Disable ignore filtering --hidden -u # Show hidden files (-u = --unrestricted) -a --text # Search binary files -L --follow # Follow symlinks -uuu # Disable all filtering (3x unrestricted) ``` ### Manual Filtering: Globs ```bash rg pattern -g '*.toml' # Only .toml files rg pattern -g '!*.toml' # Exclude .toml files rg pattern -g '*.rs' -g '!test*' # Combine filters ``` ### File Types ```bash rg pattern --type rust # -t<type> shorthand rg pattern --type-not rust # -T<type> exclude type rg pattern --type-list # List available types rg --type-add 'web:*.{html,css,js}' -tweb pattern # Custom type ``` ### Replacements ```bash rg fast README.md --replace FAST # -r shorthand rg '^.*fast.*$' README.md -r FAST # Replace entire line rg 'fast\s+(\w+)' -r 'fast-$1' # Capture groups ``` ### Configuration Set `RIPGREP_CONFIG_PATH` env var. Each line is a flag: ```text --max-columns=150 --hidden --smart-case ``` ## Common Options | Flag | Description | |------|-------------| | `-i --ignore-case` | Case insensitive search | | `-S --smart-case` | Case insensitive unless pattern has uppercase | | `-w --word-regexp` | Match whole words only | | `-c --count` | Count matching lines | | `-C --context N` | Show N lines around match | | `-U --multiline` | Allow multiline matches | | `-M --max-columns N` | Truncate long lines | | `-z --search-zip` | Search compressed files | | `-l --files-with-matches` | Print only filenames | | `-o --only-matching` | Show only match, not full line | | `--debug` | Show debug info (why files ignored, config loaded) | ## Preprocessor (Search Binary/Non-text) ```bash # Create preprocessor script cat preprocess #!/bin/sh exec pdftotext - - # Use it rg --pre ./preprocess 'pattern' file.pdf rg --pre ./preprocess --pre-glob '*.pdf' 'pattern' . ```
GitHub에서 보기