News for hackers. Stuff that matters.
Re:Ack - better than grep, a power search tool for programmers by dylanz on Thursday December 03, 2009 @08:12PM (#975582)
I've been using Ack for a while, and really like it. It saves a few keystrokes, and gives you a nice (colored) output of the results with line numbers as well:

> grep -r unicorn .

./config/unicorn/unicorn_build.rb: logger unicorn_logger

./config/unicorn/unicorn_build.rb: old_pid = '/home/rails/xxxxx/current/tmp/pids/unicorn.pid.oldbin

./config/unicorn/unicorn_production.rb: '/home/rails/xxxxx/current/tmp/pids/unicorn.pid.oldbin'

> ack unicorn

config/unicorn/unicorn_build.rb

10:# logger unicorn_logger

14:# old_pid = '/home/rails/xxxxx/current/tmp/pids/unicorn.pid.oldbin'

config/unicorn/unicorn_production.rb

15:# '/home/rails/xxxxx/current/tmp/pids/unicorn.pid.oldbin'

Re:Ack - better than grep, a power search tool for programmers by dylanz on Thursday December 03, 2009 @08:15PM (#975589)
One day I'll grok the formatting for HN. Just not today obviously :/
Re:Ack - better than grep, a power search tool for programmers by basugasubaku on Thursday December 03, 2009 @08:19PM (#975595)
FWIW "grep --color -n" does the same thing.
Re:Ack - better than grep, a power search tool for programmers by dylanz on Thursday December 03, 2009 @08:24PM (#975603)
Ah, thank you! Can't believe I haven't been using the -n flag all this time. These flags don't do "exactly" the same thing as Ack, as Ack actually breaks it down by distinct sections, with newlines. It's a bit easier on the eyes.
Re:Ack - better than grep, a power search tool for programmers by mseebach on Friday December 04, 2009 @08:41AM (#976302)
Not if you're using SVN. Or if someone stuck a 24MB SQL data-dump with extended inserts somewhere, that has the word "unicorn" in it.
Re:Ack - better than grep, a power search tool for programmers by youngian on Friday December 04, 2009 @04:31PM (#977253)
The newest version of grep has --exclude-dir, which handles .svn folders just fine.