The best grep tool in the world; ripgrep

19 June 2018   0 comments   Linux, Web development, MacOSX

https://github.com/BurntSushi/ripgrep

tl;dr; ripgrep (aka. rg) is the best tool to grep today.

ripgrep is a tool for searching files. Its killer feature is that it's fast. Like, really really fast. Faster than sift, git grep, ack, regular grep etc.

If you don't believe me, either read this detailed blog post from its author or just jump straight to the conclusion:

Benchmark
Benchmark

I used to use git grep whenever I was inside a git repo and sift for everything else. That alone, was a huge step up from regular grep. Granted, almost all my git repos are small enough that regular git grep is faster than I can perceive many times. But with ripgrep I can just add --no-ignore-vcs and it searches in all the files mentioned in .gitignore too. That's useful when you want to search in your own source as well as the files in node_modules.

The installation instructions are easy. I installed it with brew install ripgrep and the best way to learn how to use it is rg --help. Remember that it has a lot of cool features that are well worth learning. It's written in Rust and so far I haven't had a single crash, ever. The ability to search by file type gets some getting used to (tip! use: rg --type-list) and remember that you can pipe rg output to another rg. For example, to search for all lines that contain query and string you can use rg query | rg string.

Comments

Your email will never ever be published


Related posts

Previous:
How to unset aliases set by Oh My Zsh 14 June 2018
Next:
A good Django view function cache decorator for http.JsonResponse 20 June 2018
Related by Keyword:
Rust > Go > Python ...to parse millions of dates in CSV files 15 May 2018
How I found out where a bash alias was set up 09 May 2018
gg - wrapping git-grep 11 August 2009
Redirect stderr into becoming dots in Bash 02 September 2006
Grep results expanded 23 April 2005
Related by Text:
jQuery and Highslide JS 08 January 2008
I'm back! Peterbe.com has been renewed 05 June 2005
Anti-McCain propaganda videos 12 August 2008
Ever wondered how much $87 Billion is? 04 November 2003
Guake, not Yakuake or Yeahconsole 23 January 2010