Hi all, I’ve been using an app called “ripgrep” for a while now and wanted to share it with the community.
https://github.com/BurntSushi/ripgrep
“ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern.”
ripgrep is written in Rust which is “blazingly fast” for this type of operation. I found this article very interesting on the subject of benchmarking
https://blog.burntsushi.net/ripgrep/
Finding the specific file or files where something occurred can be tricky, but ripgrep makes it easy with a simple regex pattern.
rg "^.*?\b13.02.2023\b.*?\bError\b.*?$"
It provides each instance that matches the expression under the file's name.
It also allows you to use flags to alter the output; the most useful I’ve found are the -A, -B and -C flags.
-A Provides a number of lines before the match
-B Provides a number of lines after the match
-C Provide a number of lines before and after the match
Many other flags can be used, including a flag that recursively looks through zipped folders (unsurprisingly, that is the -z flag)
You can also show the files where the match occurred with the -l flag, which helps you hone in on the specific file you need to find.
I hope it helps someone!
Ed