Is there anything grep does better than ack?

1

1

I started using ack a while ago and it's amazing, but still begs the question:

Is there anything grep still does better than ack?

Or maybe is there something grep does that ack can't do?

user308285

Posted 2014-07-01T00:35:18.090

Reputation:

Question was closed 2014-07-04T17:37:58.987

Answers

1

You should have a look at the man page and it will tell you:

WHEN TO USE GREP
   ack-grep trumps grep as an everyday tool 99% of the time, but don't
   throw grep away, because there are times you'll still need it.

   E.g., searching through huge files looking for regexes that can be
   expressed with grep syntax should be quicker with grep.

   If your script or parent program uses grep "--quiet" or "--silent" or
   needs exit 2 on IO error, use grep.

Jakke

Posted 2014-07-01T00:35:18.090

Reputation: 910

Thats very interesting, however I'm still interested on things that both of them do but grep exceeds or things that ack can't do but grep can... I'm sure theres much more to this than the man page. – None – 2014-07-01T06:32:47.543

0

ack is not part of default installation on all Linux/Unix server but grep is. Have you tried the_silver_searcher or the_platinum_searcher. They both run faster than ack

Ask and Learn

Posted 2014-07-01T00:35:18.090

Reputation: 248

0

If you're searching binary files, then you must use grep because ack will ignore them, always.

When searching through a few large files, grep will be faster than ack.

It sounds like you're trying to decide if you should abandon grep and use ack all the time, and I suggest that you should not. You should use both grep and ack when it's appropriate. Basically, ack is for searching source code, and grep is for general-purpose searching.

Andy Lester

Posted 2014-07-01T00:35:18.090

Reputation: 1 121