Live data from Hacker News

Feature comparison of ack, ag, git-grep, GNU grep and ripgrep

beyondgrep.com

11–20 of 101 posts

Re: Feature comparison of ack, ag, git-grep, GNU grep and ripgrep

#11
post #7

switched from ag to rg a few months ago and have nothing but good things to say about the experience.

I switched also recently, the thing that helped me was adding this:

alias rg='rg -S'

to my .bashrc so that rg had the same default case sensitivity as ag.

Re: Feature comparison of ack, ag, git-grep, GNU grep and ripgrep

#14
post #3

as a long time user of `find . -name "*.foo" -exec grep -Hin {} \;` moving to ack has been great! I love the syntax and the speed and the fact that it actually respects your ignore files. ripgrep is great too. ag on the other hand is recommended by everyone but doesn't seem to respect ignores or understand modern ignore syntax. give it a pass. https://github.com/ggreer/the_silver_searcher/issues/385 its been over 4 y…

Spawning a separate grep for each file? That's terribly inefficient. At least use xargs which will run one process on as many files as possible.

But you know there's a -r for recursive, right? And unless you are using some historic relic of grep that is not GNU or BSD and doesn't understand the --include option you can just do:

grep -rin "needle" --include "*.foo" .

Re: Feature comparison of ack, ag, git-grep, GNU grep and ripgrep

#16
post #7

switched from ag to rg a few months ago and have nothing but good things to say about the experience.

Same here. Ripgrep works like a charm Ack requires Perl, which I am not going to install just for that purpose.

Sorry if this sounds rude, but how do you not have perl already installed? It's come with every distro I've ever used.

Re: Feature comparison of ack, ag, git-grep, GNU grep and ripgrep

#17
post #7

switched from ag to rg a few months ago and have nothing but good things to say about the experience.

Same here. Ripgrep works like a charm Ack requires Perl, which I am not going to install just for that purpose.

What kind of OS are you running that Perl isn't installed already?

Re: Feature comparison of ack, ag, git-grep, GNU grep and ripgrep

#18
Nice feature-level comparison.

Don't know how you'd pull it off in the current tabular format, but would be great to include some of the UX side of things: For example, I use rg almost exclusively because it has an easy-to remember syntax (`rg search-string` is a recursive search), attractively colored and well-organized output, and seems much faster compared to other tools in my use cases.

Re: Feature comparison of ack, ag, git-grep, GNU grep and ripgrep

#19
post #15

rg for the win. It's not some huge improvement, but it's more of a feeling that things just work by default (similar to what I get from tmux vs screen).

I've got the reverse feeling recently, as ag does smartcase searching by default and rg doesn't...

Re: Feature comparison of ack, ag, git-grep, GNU grep and ripgrep

#20
Seems pretty comprehensive. One confusing thing I found was these two: "Don't respect ignore files (.gitignore, .ignore, etc)" vs "Skip rules found in VCS ignore files (.gitignore, .hgignore, etc)"

Aren't those the same thing? Shouldn't they be grouped for better comparison?

Post reply on HN