DEV Community

João Vitor
João Vitor

Posted on

3 2

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

Top comments (0)

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay