Tools cover

ripgrep: Search for a String Literal

Doing a literal search with ripgrep is easy and can be done with the -F parameter. To search for a string literal and not a regex, use: rg -F 'my string literal' Searching for a string literal is useful when you have to look for a string that ripgrep would interpret as regex (this behavior is by default). This is often the case when searching for snippets of code. For example, ...

October 29, 2024
Tools cover

ripgrep: Suppress 'Access is Denied' error message

Ripgrep (rg) is a popular command-line search tool based on the popular GNU grep tool. The Access is denied. (os error 5) is a common error message that appears when trying to read a file or directory that ripgrep does not have permission to access. This can be annoying when doing a system wide search when many system directories or other protected directories may be searched, littering the results with many “access is denied” error messages. Luckily the messages can be suppressed. ...

September 10, 2024
Tools cover

ripgrep: Search Stats and Match Count

When searching through large code bases or directories, it’s helpful to get a sense of how many matches were found by your search query. While tools like ripgrep can give you the exact lines where a match was found, they don’t always provide an easy way to see the total number of hits. This is where ripgrep --stats and --count comes in. With these arguments we can get stats about what was found and results per file. ...

September 9, 2024