ACK – Better than GREP

One of the most useful tools in unix is grep. Almost every unix/linux user use it frequently. But not many know about a tool which is better then grep – ack. It makes life so easy for you. Some of the features that made me switch to ack:

  • Lot faster than grep.
  • Default recursive search.
  • Ignores most of the crap you don’t want to search: SVN, CVS, binary files, etc.

So instead of doing

grep -r ‘string’ . | grep -v ‘\.svn’ | grep -v ‘FreeBSD’

I can do

ack ‘string’

  • By default searches only the files that it recognizes. You can edit the list of files so that ack can recognize them or use a flag to search all files.
  • Color highlighting of search results.

Since ack is written in perl, it has ports for both mac and windows.

So if you haven’t used ack yet, give it a try. Trust me, you’ll love it.

Leave a Reply

Your email address will not be published. Required fields are marked *