brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: rg skips ignored and hidden files, and -uu searches them too

Search
~/tips/ripgrep-u

rg -u 'API_KEY' # also searches ignored files

Makes ripgrep also search ignored and hidden files, such as .env.

If rg finds nothing in a folder where I am sure the text exists, the cause is usually that ripgrep is being polite.

By default it skips files that your .gitignore lists, hidden files and binary files. Each -u switches off one of those filters:

rg -u 'API_KEY'     # also searches ignored files
rg -uu 'API_KEY'    # also searches hidden files such as .env
rg -uuu 'API_KEY'   # also searches binary files

That is how a hit in a .env file shows up when the plain search says nothing.

Caveat: -uu walks into folders like node_modules as well, and the output gets long. Cut them out with rg -uu -g '!node_modules' 'API_KEY'.

Further reading: ripgrep user guide

Going deeper: Run degoog on Unraid as your own search page, compared with SearXNG and 4get

More Search tips !!wfr Wau Holland zipgrep db_host backup.zip pdfgrep -rin "warranty" ~/Documents "fatal error" repo:github-linguist/linguist is:open involves:@me All Search tips (11) All topics

Link