Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 1.05 KB

unrestrict-where-ripgrep-searches.md

File metadata and controls

33 lines (24 loc) · 1.05 KB

Unrestrict Where ripgrep Searches

One of the conveniences of rg (ripgrep) is that by default it doesn't search in places you probably don't want it to search. That means it ignores anything specified by your .gitignore file, it excludes hidden files and directories (dotfiles, e.g. .git/ or .env), and it excludes binary files.

These restrictions can be incrementally undone as needed using the -u flag.

The -u flag on its own will remove the ignored files restriction. This is equivalent to the --no-ignore flag.

$ rg -u pattern

Adding an additional u (-uu) to that flag will remove both the ignored files and hidden files restrictions. This is a shorthand equivalent to both --no-ignore and --hidden.

$ rg -uu pattern

Adding one more u (-uuu) will additionally remove the binary file restriction. Equivalent to those other two flags plus --text.

$ rg -uuu pattern

source