Upgrading grep in OS X Revisited
Just the other day I realized I was using the OS X stock
grep, which was
lacking a few features I wanted, some features in particular are the ability to
fully color highlight grep results with the
--color option, or to exclude
directories from searches using the
I was shocked to find one of the first results in google was my own blog from when I previously wrote about this back in March.
brew tap homebrew/dupes brew install homebrew/dupes/grep
Note that the new grep will install to
/usr/local/bin which usually appears
/usr/bin/ which contains your stock OS X grep, giving priority to the
OS X grep.
You can either finagle the paths in your
~/.bash_rc or do as I
did and create a one-off alias for any OS X duplicate software you’ve installed,
which I feel gives more control over switching it on and off if you need to for
alias grep='/usr/local/bin/grep --color'
Another bonus to using this method is that it will put the duplicated packages
you are currently using in plain site in your
blog comments powered by Disqus