rg instead of grep

joaovitor

João Vitor

Posted on December 6, 2019

rg instead of grep

ripgrep aka rg provides great defaults to search inside files.

It automatically skip .git directories and files ignored by git reducing the amount of data being searched.

These are sane defaults to have and can safe you a lot of development time.

Searching for the same word inside the same directory gives me this.

With rg

time rg -li 'pattern'
Enter fullscreen mode Exit fullscreen mode
real    0m17.514s
user    0m15.610s
sys     0m8.822s
Enter fullscreen mode Exit fullscreen mode

With grep

time grep -ilR 'pattern'
Enter fullscreen mode Exit fullscreen mode
real    1m9.520s
user    0m29.768s
sys     0m8.352s
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
joaovitor
João Vitor

Posted on December 6, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

rg instead of grep
rg rg instead of grep

December 6, 2019