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.
> 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'