ripgrep

A very fast recursive search that honours ignore rules

About

A modern search tool that skips hidden entries and anything in ignore files by default. It is multi-threaded, colourises output, and handles many archive and encoding cases. Use it in place of the older recursive search when speed and good defaults matter.

Install it

pkg install ripgrep

Run this inside Termux. If the package is already present, pkg will say so and do nothing.

Commands worth knowing

6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.

rg TODO src/ Search a directory tree for the pattern. Each hit shows its path and line number.
rg -i timeout Match case-insensitively wherever the search goes.
rg -t js Limit the search to one language type.
rg -l "import React" List only the paths that contain a match, not the lines.
rg -w error Match whole words only. Substrings inside longer words are ignored.
rg -uu Include hidden entries and ignored paths in the search.

Worked example

Run rg -i timeout and this is what you should see.

termux
$ rg -i timeout
src/api.ts:52:// TODO: retry on timeout
src/api.ts:88:const TIMEOUT_MS = 5000
docs/guide.md:12:increase the timeout if requests fail

Developed by

Andrew Gallant .