6 ms·
1000 times this... it is exactly like ack-grep but faster :)
by pmelendez 12y ago
1000 times this... it is exactly like ack-grep but faster :)
- 5h 12y agoI normally tell people to use ack because it's like grep but faster (owing to it's sensible defaults) ... if I use this I'm worried I might go too fast and travel backwards in time or something.
- csgavino1 12y agoGive ag a shot, you'll be able to relive the emotions you felt when you switched to ack from grep, but this time you're switching to ag from ack.
- djeikyb 12y agoOne thing I miss a little is that ack has the super convenient: ack --java "foo" while with ag you write: ag -G"\.java$" "foo" But yes, ack and ag feel pretty identical except for the speed. Most of the time the speed improvement is irrelevant to me, except sometimes now I'll use ag in my home folder, and it's still fairly snappy.
- tsenkov 12y agoJudging by this: https://news.ycombinator.com/item?id=7710269 https://news.ycombinator.com/item?id=7710269 I guess ag now supports that, too.
- coffeeaddicted 12y agoThat was too much typing anyway. When you mostly work with one language something like this is nice (in my case c/c++): alias ack-cpp='ack-grep --type=cpp --type=cc'
- llimllib 12y agoI have that aliased to 'cack'. Then ruby is 'rack', python is 'pack', go is 'gack', etc. (I've never needed to use the rackup "rack" command directly, fortunately, if you do you ought to use a different alias)
- irahul 12y ago> I've never needed to use the rackup "rack" command directly, fortunately, if you do you ought to use a different alias Or escape alias \rack
- alxndr 12y agoor $(which rack)
- alxndr 12y agoHm, I've recently begun using zsh primarily and this trick doesn't work there: zsh lets you know what the alias is... bash will happily find `rack` in your `$PATH` and then run it. (Presumably because in zsh, `which which` says it's a shell built-in, whereas in bash it finds `/usr/bin/which`, so bash doesn't seem to be caring about your aliases.)
- beaumartinez 12y agoag has had this for a while now (I'm on version 0.21.0).
- djeikyb 12y agonice! i need to pull and recompile!
- rickyc091 12y agoThanks for the ack tip! Anything else super useful come to mind?
- petdance 12y agoag is not "exactly like" ack. There are features that ack has that ag has chosen not to replicate. ack is also more portable. That's not a knock on ag at all, and if ag fits your needs, then by all means use it.