README.md (ripgrep-12.1.1) | : | README.md (ripgrep-13.0.0) | ||
---|---|---|---|---|
ripgrep (rg) | ripgrep (rg) | |||
------------ | ------------ | |||
ripgrep is a line-oriented search tool that recursively searches your current | ripgrep is a line-oriented search tool that recursively searches the current | |||
directory for a regex pattern. By default, ripgrep will respect your .gitignore | directory for a regex pattern. By default, ripgrep will respect gitignore rules | |||
and automatically skip hidden files/directories and binary files. ripgrep | and automatically skip hidden files/directories and binary files. ripgrep | |||
has first class support on Windows, macOS and Linux, with binary downloads | has first class support on Windows, macOS and Linux, with binary downloads | |||
available for [every release](https://github.com/BurntSushi/ripgrep/releases). | available for [every release](https://github.com/BurntSushi/ripgrep/releases). | |||
ripgrep is similar to other popular search tools like The Silver Searcher, ack | ripgrep is similar to other popular search tools like The Silver Searcher, ack | |||
and grep. | and grep. | |||
[]( https://github.com/BurntSushi/ripgrep/actions) | []( https://github.com/BurntSushi/ripgrep/actions) | |||
[](https://crates.io/cr ates/ripgrep) | [](https://crates.io/cr ates/ripgrep) | |||
[](https:/ /repology.org/project/ripgrep/badges) | [](https:/ /repology.org/project/ripgrep/badges) | |||
skipping to change at line 96 | skipping to change at line 96 | |||
because it contains most of their features and is generally faster. (See | because it contains most of their features and is generally faster. (See | |||
[the FAQ](FAQ.md#posix4ever) for more details on whether ripgrep can truly | [the FAQ](FAQ.md#posix4ever) for more details on whether ripgrep can truly | |||
replace grep.) | replace grep.) | |||
* Like other tools specialized to code search, ripgrep defaults to recursive | * Like other tools specialized to code search, ripgrep defaults to recursive | |||
directory search and won't search files ignored by your | directory search and won't search files ignored by your | |||
`.gitignore`/`.ignore`/`.rgignore` files. It also ignores hidden and binary | `.gitignore`/`.ignore`/`.rgignore` files. It also ignores hidden and binary | |||
files by default. ripgrep also implements full support for `.gitignore`, | files by default. ripgrep also implements full support for `.gitignore`, | |||
whereas there are many bugs related to that functionality in other code | whereas there are many bugs related to that functionality in other code | |||
search tools claiming to provide the same functionality. | search tools claiming to provide the same functionality. | |||
* ripgrep can search specific types of files. For example, `rg -tpy foo` | * ripgrep can search specific types of files. For example, `rg -tpy foo` | |||
limits your search to Python files and `rg -Tjs foo` excludes Javascript | limits your search to Python files and `rg -Tjs foo` excludes JavaScript | |||
files from your search. ripgrep can be taught about new file types with | files from your search. ripgrep can be taught about new file types with | |||
custom matching rules. | custom matching rules. | |||
* ripgrep supports many features found in `grep`, such as showing the context | * ripgrep supports many features found in `grep`, such as showing the context | |||
of search results, searching multiple patterns, highlighting matches with | of search results, searching multiple patterns, highlighting matches with | |||
color and full Unicode support. Unlike GNU grep, ripgrep stays fast while | color and full Unicode support. Unlike GNU grep, ripgrep stays fast while | |||
supporting Unicode (which is always on). | supporting Unicode (which is always on). | |||
* ripgrep has optional support for switching its regex engine to use PCRE2. | * ripgrep has optional support for switching its regex engine to use PCRE2. | |||
Among other things, this makes it possible to use look-around and | Among other things, this makes it possible to use look-around and | |||
backreferences in your patterns, which are not supported in ripgrep's default | backreferences in your patterns, which are not supported in ripgrep's default | |||
regex engine. PCRE2 support can be enabled with `-P/--pcre2` (use PCRE2 | regex engine. PCRE2 support can be enabled with `-P/--pcre2` (use PCRE2 | |||
skipping to change at line 187 | skipping to change at line 187 | |||
Note that ripgrep has grown a few significant new features recently that | Note that ripgrep has grown a few significant new features recently that | |||
are not yet present in Andy's table. This includes, but is not limited to, | are not yet present in Andy's table. This includes, but is not limited to, | |||
configuration files, passthru, support for searching compressed files, | configuration files, passthru, support for searching compressed files, | |||
multiline search and opt-in fancy regex support via PCRE2. | multiline search and opt-in fancy regex support via PCRE2. | |||
### Installation | ### Installation | |||
The binary name for ripgrep is `rg`. | The binary name for ripgrep is `rg`. | |||
**[Archives of precompiled binaries for ripgrep are available for Windows, | **[Archives of precompiled binaries for ripgrep are available for Windows, | |||
macOS and Linux.](https://github.com/BurntSushi/ripgrep/releases)** Users of | macOS and Linux.](https://github.com/BurntSushi/ripgrep/releases)** Linux and | |||
platforms not explicitly mentioned below are advised to download one of these | Windows binaries are static executables. Users of platforms not explicitly | |||
archives. | mentioned below are advised to download one of these archives. | |||
Linux binaries are static executables. Windows binaries are available either as | ||||
built with MinGW (GNU) or with Microsoft Visual C++ (MSVC). When possible, | ||||
prefer MSVC over GNU, but you'll need to have the [Microsoft VC++ 2015 | ||||
redistributable](https://www.microsoft.com/en-us/download/details.aspx?id=48145) | ||||
installed. | ||||
If you're a **macOS Homebrew** or a **Linuxbrew** user, then you can install | If you're a **macOS Homebrew** or a **Linuxbrew** user, then you can install | |||
ripgrep from homebrew-core: | ripgrep from homebrew-core: | |||
``` | ``` | |||
$ brew install ripgrep | $ brew install ripgrep | |||
``` | ``` | |||
If you're a **MacPorts** user, then you can install ripgrep from the | If you're a **MacPorts** user, then you can install ripgrep from the | |||
[official ports](https://www.macports.org/ports.php?by=name&substr=ripgrep): | [official ports](https://www.macports.org/ports.php?by=name&substr=ripgrep): | |||
skipping to change at line 273 | skipping to change at line 267 | |||
``` | ``` | |||
$ nix-env --install ripgrep | $ nix-env --install ripgrep | |||
$ # (Or using the attribute name, which is also ripgrep.) | $ # (Or using the attribute name, which is also ripgrep.) | |||
``` | ``` | |||
If you're a **Debian** user (or a user of a Debian derivative like **Ubuntu**), | If you're a **Debian** user (or a user of a Debian derivative like **Ubuntu**), | |||
then ripgrep can be installed using a binary `.deb` file provided in each | then ripgrep can be installed using a binary `.deb` file provided in each | |||
[ripgrep release](https://github.com/BurntSushi/ripgrep/releases). | [ripgrep release](https://github.com/BurntSushi/ripgrep/releases). | |||
``` | ``` | |||
$ curl -LO https://github.com/BurntSushi/ripgrep/releases/download/11.0.2/ripgre | $ curl -LO https://github.com/BurntSushi/ripgrep/releases/download/12.1.1/ripgre | |||
p_11.0.2_amd64.deb | p_12.1.1_amd64.deb | |||
$ sudo dpkg -i ripgrep_11.0.2_amd64.deb | $ sudo dpkg -i ripgrep_12.1.1_amd64.deb | |||
``` | ``` | |||
If you run Debian Buster (currently Debian stable) or Debian sid, ripgrep is | If you run Debian Buster (currently Debian stable) or Debian sid, ripgrep is | |||
[officially maintained by Debian](https://tracker.debian.org/pkg/rust-ripgrep). | [officially maintained by Debian](https://tracker.debian.org/pkg/rust-ripgrep). | |||
``` | ``` | |||
$ sudo apt-get install ripgrep | $ sudo apt-get install ripgrep | |||
``` | ``` | |||
If you're an **Ubuntu Cosmic (18.10)** (or newer) user, ripgrep is | If you're an **Ubuntu Cosmic (18.10)** (or newer) user, ripgrep is | |||
[available](https://launchpad.net/ubuntu/+source/rust-ripgrep) using the same | [available](https://launchpad.net/ubuntu/+source/rust-ripgrep) using the same | |||
skipping to change at line 304 | skipping to change at line 298 | |||
longer a recommended installation option.) | longer a recommended installation option.) | |||
If you're a **FreeBSD** user, then you can install ripgrep from the | If you're a **FreeBSD** user, then you can install ripgrep from the | |||
[official ports](https://www.freshports.org/textproc/ripgrep/): | [official ports](https://www.freshports.org/textproc/ripgrep/): | |||
``` | ``` | |||
# pkg install ripgrep | # pkg install ripgrep | |||
``` | ``` | |||
If you're an **OpenBSD** user, then you can install ripgrep from the | If you're an **OpenBSD** user, then you can install ripgrep from the | |||
[official ports](http://openports.se/textproc/ripgrep): | [official ports](https://openports.se/textproc/ripgrep): | |||
``` | ``` | |||
$ doas pkg_add ripgrep | $ doas pkg_add ripgrep | |||
``` | ``` | |||
If you're a **NetBSD** user, then you can install ripgrep from | If you're a **NetBSD** user, then you can install ripgrep from | |||
[pkgsrc](http://pkgsrc.se/textproc/ripgrep): | [pkgsrc](https://pkgsrc.se/textproc/ripgrep): | |||
``` | ``` | |||
# pkgin install ripgrep | # pkgin install ripgrep | |||
``` | ``` | |||
If you're a **Haiku x86_64** user, then you can install ripgrep from the | If you're a **Haiku x86_64** user, then you can install ripgrep from the | |||
[official ports](https://github.com/haikuports/haikuports/tree/master/sys-apps/r ipgrep): | [official ports](https://github.com/haikuports/haikuports/tree/master/sys-apps/r ipgrep): | |||
``` | ``` | |||
$ pkgman install ripgrep | $ pkgman install ripgrep | |||
skipping to change at line 417 | skipping to change at line 411 | |||
ripgrep is relatively well-tested, including both unit tests and integration | ripgrep is relatively well-tested, including both unit tests and integration | |||
tests. To run the full test suite, use: | tests. To run the full test suite, use: | |||
``` | ``` | |||
$ cargo test --all | $ cargo test --all | |||
``` | ``` | |||
from the repository root. | from the repository root. | |||
### Vulnerability reporting | ||||
For reporting a security vulnerability, please | ||||
[contact Andrew Gallant](https://blog.burntsushi.net/about/), | ||||
which has my email address and PGP public key if you wish to send an encrypted | ||||
message. | ||||
### Translations | ### Translations | |||
The following is a list of known translations of ripgrep's documentation. These | The following is a list of known translations of ripgrep's documentation. These | |||
are unofficially maintained and may not be up to date. | are unofficially maintained and may not be up to date. | |||
* [Chinese](https://github.com/chinanf-boy/ripgrep-zh#%E6%9B%B4%E6%96%B0-) | * [Chinese](https://github.com/chinanf-boy/ripgrep-zh#%E6%9B%B4%E6%96%B0-) | |||
* [Spanish](https://github.com/UltiRequiem/traducciones/tree/master/ripgrep) | ||||
End of changes. 8 change blocks. | ||||
17 lines changed or deleted | 18 lines changed or added |