Forrest logo
tool overview
On this page you find all important commands for the CLI tool rg. If the command you are looking for is missing please ask our AI.

rg

"rg" stands for "ripgrep" and it is a command line tool used for fast and efficient searching in text files. It is designed to be faster than other similar tools like "grep" by utilizing parallel processing techniques. Rg supports various search patterns including regular expressions and it can search through multiple files and directories simultaneously. It is written in a system programming language called Rust, which emphasizes safety, concurrency, and performance. Rg provides many features such as line numbering, highlighting, including and excluding files or directories from search, and filtering by file types. It automatically ignores hidden files and directories by default, making search results cleaner. Rg's search results are colorized by default, making it easier to identify matching patterns. It supports smart case by default, which means if the search pattern contains uppercase letters, rg will perform a case-sensitive search; otherwise, it will perform case-insensitive search. Rg provides multiple command line options for customization and optimization, so users can fine-tune the search process according to their needs. It is widely used by software developers, system administrators, and power users to quickly search large codebases, logs, and other text files.

List of commands for rg:

  • rg:tldr:205de rg: Search for filenames that match a regular expression.
    $ rg --files | rg ${regular_expression}
    try on your machine
    explain this command
  • rg:tldr:3514c rg: Search for regular expressions recursively in the current directory, including hidden files and files listed in `.gitignore`.
    $ rg --no-ignore --hidden ${regular_expression}
    try on your machine
    explain this command
  • rg:tldr:37f82 rg: Only list matched files (useful when piping to other commands).
    $ rg --files-with-matches ${regular_expression}
    try on your machine
    explain this command
  • rg:tldr:55b1b rg: Search for a regular expression in files matching a glob (e.g. `README.*`).
    $ rg ${regular_expression} --glob ${glob}
    try on your machine
    explain this command
  • rg:tldr:842e5 rg: Search for a regular expression only in a subset of directories.
    $ rg ${regular_expression} ${set_of_subdirs}
    try on your machine
    explain this command
  • rg:tldr:a3c42 rg: Show lines that do not match the given regular expression.
    $ rg --invert-match ${regular_expression}
    try on your machine
    explain this command
  • rg:tldr:e9493 rg: Recursively search the current directory for a regular expression.
    $ rg ${regular_expression}
    try on your machine
    explain this command
tool overview