What is ripgrep (rg)?
ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern. By default, ripgrep will respect gitignore rules and automatically skip hidden files/directories and binary files. ripgrep has first class support on Windows, macOS and Linux, with binary downloads available for every release. ripgrep is similar to other popular search tools like The Silver Searcher, ack and grep.
Install ripgrep (rg) on MAC OS:
1 2 |
## Using homebrew brew install ripgrep |
Install ripgrep (rg) on Arch Linux OS:
1 2 |
## Using pacman pacman -S ripgrep |
Install ripgrep (rg) on Windows OS:
1 2 |
## Using chocolety choco install ripgrep |
Install ripgrep (rg) on Gentoo OS:
1 2 |
## Using emerge emerge sys-apps/ripgrep |
Install ripgrep (rg) on Fedora OS:
1 2 |
## Using dnf sudo dnf install ripgrep |
Install ripgrep (rg) on RHEL and CentOS OS:
1 2 3 |
## Using yum sudo yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo sudo yum install ripgrep |
Install ripgrep (rg) on Ubuntu and Debian OS:
1 2 3 4 5 6 |
## Using dpkg curl -LO https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb sudo dpkg -i ripgrep_13.0.0_amd64.deb ## Using apt sudo apt-get install ripgrep |
Install ripgrep (rg) on FreeBDS OS:
1 2 |
## Using pkg pkg install ripgrep |
Install ripgrep (rg) on OpenBDS OS:
1 2 |
## Using pkg_add doas pkg_add ripgrep |
From source:
ripgrep is written in Rust, so you’ll need to grab a Rust installation in order to compile it. ripgrep compiles with Rust 1.34.0 (stable) or newer. In general, ripgrep tracks the latest stable release of the Rust compiler.
1 2 3 4 5 |
git clone https://github.com/BurntSushi/ripgrep cd ripgrep cargo build --release ./target/release/rg --version 0.1.3 |
Confirm if the installation was successful:
1 2 |
## Check rg version rg --version |
To get more details on ripgrep (rg) please refer https://github.com/BurntSushi/ripgrep