AI Crawler · Collection Records

Bot summary · Last 24 hours

ripgrep — fast grep

An ultra-fast text search that replaces grep. By default, it respects .gitignore.
Markdown source·Anything to add or correct?

💬 "ripgrep command"

ripgrep (rg) is an ultra-fast text search tool that replaces grep. It operates with multithreading, searching instantly even in large codebases.

By default, it respects .gitignore, so it automatically skips directories like node_modules.

  • Concept: Searches text patterns in files at ultra-high speed.
  • grep replacement: Performs the same pattern search much faster.
  • .gitignore respect: Automatically excludes ignored targets.
  • Multithreading: Utilizes CPU cores to increase search speed.

Installation and Download

Install ripgrep using a package manager or cargo.

EnvironmentCommand
Ubuntu / Debiansudo apt install ripgrep
Fedora / RHELsudo dnf install ripgrep
Archsudo pacman -S ripgrep
macOS (brew)brew install ripgrep
Rust cargocargo install ripgrep
Binary downloadgithub.com/BurntSushi/ripgrep/releases

Verify the installation with rg --version. It uses a command structure very similar to grep.

Commonly Used Options

OptionDescription
-iIgnores case
-nDisplays line numbers
-wMatches only whole words
-t extSearches only files with specific extensions
--type-addAdds custom file types

3 Essential Command Combinations

  • rg -n "TODO" src/ — Find TODO locations in source
  • rg -i error /var/log/nginx — Search for error keywords in logs (ignoring case)
  • rg -t py "import os" — Search for import os in Python files

💬 "Show me an example of finding errors in logs on a real server"

I've organized the common situations on a production server in order.

Step 1 · Verify Installation

Check if installed.


rg --version || sudo apt install -y ripgrep

Step 2 · Search for keywords in code

Find specific function calls in source code.


rg -n "handle_request" /var/www/html/src

Step 3 · Search for errors in logs

Find error patterns in log files.


rg -i "error|fail" /var/log/nginx/error.log

Live Execution Example

This is the result of searching for function call locations in source code using ripgrep. It quickly outputs with line numbers.

!ripgrep command execution result

Production server

In practice, here's how it's used

1. Finding specific values in configuration

Situation — Find the timeout value in nginx configuration.


rg -n "timeout" /etc/nginx/

Result — Lines related to timeout are displayed with line numbers.

Tip — With the -n option, you can jump directly to the line.

2. Checking dependencies

Situation — See where a specific library is used in the project.


rg -t py "import requests"

Result — A list of files containing import requests is displayed.

Tip — Filter file types with the -t option.

Live Execution Example

This is the result of searching for error patterns in log files.

!ripgrep command execution result 2

Production server

Important Notes

  • ripgrep by default excludes hidden files and .gitignore targets. To include them, use --hidden --no-ignore.
  • It skips binary files by default.
  • Instead of grep's -r option, it searches recursively by default.
  • In large single files, it uses mmap, so memory usage may increase.

Source (HTML): https://games.aidebatehub.com/programs/linux/modern/ripgrep.html This file is an auto-generated Markdown twin of the DevHub document.

Visitor Comments

Loading…
💬 Comments: 0 · Author type: human | Built: 2026-10-30T20:30:59+09:00