Re:Ack is a grep-like tool, optimised for programmers
by pmelendez on Wednesday May 07, 2014 @10:14AM
(#7710214)
1000 times this... it is exactly like ack-grep but faster :)
[ Parent
| on HN ]
Re:Ack is a grep-like tool, optimised for programmers
by djeikyb on Wednesday May 07, 2014 @10:24AM
(#7710265)
One 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.
Re:Ack is a grep-like tool, optimised for programmers
by coffeeaddicted on Wednesday May 07, 2014 @10:31AM
(#7710316)
That 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'
Re:Ack is a grep-like tool, optimised for programmers
by llimllib on Wednesday May 07, 2014 @11:14AM
(#7710603)
I 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)
Re:Ack is a grep-like tool, optimised for programmers
by irahul on Wednesday May 07, 2014 @11:45AM
(#7710794)
> 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
Re:Ack is a grep-like tool, optimised for programmers
by alxndr on Wednesday May 07, 2014 @06:22PM
(#7712960)
or $(which rack)
Re:Ack is a grep-like tool, optimised for programmers
by alxndr on Wednesday May 07, 2014 @10:08PM
(#7713623)
Hm, 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.)
Re:Ack is a grep-like tool, optimised for programmers
by mhei on Thursday May 08, 2014 @02:45AM
(#7714190)
If you have the EQUALS option set (by default it is), you can use =rack instead: http://zsh.sourceforge.net/Doc/Release/Expansion.html#g_t_00...
Re:Ack is a grep-like tool, optimised for programmers
by alxndr on Thursday May 15, 2014 @05:00PM
(#7752209)
Lovely, thanks!
Re:Ack is a grep-like tool, optimised for programmers
by beaumartinez on Wednesday May 07, 2014 @10:34AM
(#7710339)
ag has had this for a while now (I'm on version 0.21.0).
Re:Ack is a grep-like tool, optimised for programmers
by djeikyb on Wednesday May 07, 2014 @10:36AM
(#7710357)
nice! i need to pull and recompile!
Re:Ack is a grep-like tool, optimised for programmers
by tsenkov on Wednesday May 07, 2014 @10:31AM
(#7710314)
Judging by this: https://news.ycombinator.com/item?id=7710269 I guess ag now supports that, too.
Re:Ack is a grep-like tool, optimised for programmers
by rickyc091 on Wednesday May 07, 2014 @02:28PM
(#7711868)
Thanks for the ack tip! Anything else super useful come to mind?
Re:Ack is a grep-like tool, optimised for programmers
by petdance on Wednesday May 07, 2014 @10:43AM
(#7710400)
ag 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.
Re:Ack is a grep-like tool, optimised for programmers
by 5h on Wednesday May 07, 2014 @10:18AM
(#7710239)
I 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.