ripgrep - Recursively searches in files for a regex pattern

ripgrep recursively searches in files for a regex pattern within files. It works very efficiently by skipping directories known to be typically not interesting (e.g. .git). It is benchmarked as the fastest solution available to search in files.


ripgrep is a command line tool that searches your files for patterns that you give it. ripgrep behaves as if reading each file line by line. If a line matches the pattern provided to ripgrep, then that line will be printed. If a line does not match the pattern, then the line is not printed.

In this sense, it is very similar to the standard grep.

However, ripgrep goes beyond grep by making a recursive search and using regex by default. Moreover, it is much faster than the possible aternative made by the combination of find + grep thanks to its awareness to non interesting directories (e.g., .git) and the parallel execution. It is also faster than other similar alternatives, such as ag, ack or ugrep. The author provides benchmarks that prove that ripgrep is the fastest solution available to search in files.


References