Instead of fighting ack, you can use plain old grep since 1973. Since it uses explicitly blacklisted files and not white file types, it never misses the correct results. Given a couple of configuration lines (which I created in my dotfiles repo home directory back in the 1990s), grep actually matches or exceeds many of the stated benefits - in particular speed: when looking for the same set of grep files faster than ack.
The grep configuration that makes me happy looks like this: in my .bashrc:
# Custom 'grep' behaviour
The exact list of files and directories to ignore will probably be different for you: I'm basically a Python developer, and these settings work for me.
It is also easy to add subtasks, as I show for my "grpy", which I use for the grep source of Python.
Defining bash functions like this is preferable to setting GREP_OPTIONS, which will cause ALL grep commands from your login shell to behave differently, including those caused by the programs you started. These programs are likely to depend on unexpectedly different grep behavior.
My new features, โgrpโ and โgrpyโ, are intentionally not a shadow of โgrepโ, so I can still use the original behavior anytime I need.
Jonathan Hartley Oct 04 '11 at 11:08 2011-10-04 11:08
source share