diff --git a/README.md b/README.md index a3363f4..4bdc03b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1405 TILs and counting..._ +_1406 TILs and counting..._ --- @@ -1427,6 +1427,7 @@ _1405 TILs and counting..._ - [Tell direnv To Load The Env File](unix/tell-direnv-to-load-the-env-file.md) - [Touch Access And Modify Times Individually](unix/touch-access-and-modify-times-individually.md) - [Undo Some Command Line Editing](unix/undo-some-command-line-editing.md) +- [Unrestrict Where ripgrep Searches](unix/unrestrict-where-ripgrep-searches.md) - [Update Package Versions Known By asdf Plugin](unix/update-package-versions-known-by-asdf-plugin.md) - [Use fzf To Change Directories](unix/use-fzf-to-change-directories.md) - [Use Regex Pattern Matching With Grep](unix/use-regex-pattern-matching-with-grep.md) diff --git a/unix/unrestrict-where-ripgrep-searches.md b/unix/unrestrict-where-ripgrep-searches.md new file mode 100644 index 0000000..3984e48 --- /dev/null +++ b/unix/unrestrict-where-ripgrep-searches.md @@ -0,0 +1,33 @@ +# Unrestrict Where ripgrep Searches + +One of the conveniences of [`rg` +(ripgrep)](https://github.com/BurntSushi/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. + +```bash +$ 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`. + +```bash +$ rg -uu pattern +``` + +Adding one more `u` (`-uuu`) will additionally remove the binary file +restriction. Equivalent to those other two flags plus `--text`. + +```bash +$ rg -uuu pattern +``` + +[source](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md#automatic-filtering)