0

When using Ubuntu I get these colors when using grep (grep -r "MSP" .):

enter image description here

I want the same result when using macOS Monterey. I tried to add

export GREP_OPTIONS='--color=auto'

to my bash profile and I get only colors in the search term:

enter image description here

How can I add the colors like in the Ubuntu case, where the filenames are also colored?

jimtut
  • 1,608
  • 2
  • 11
  • 17
Miguel
  • 101
  • 4
  • The BSD grep implementation differs from the GNU one. Have a look at this port: https://apple.stackexchange.com/questions/228322/how-to-grep-with-filename-highlighted-in-one-color-and-the-match-highlighted-in – mashuptwice Mar 19 '22 at 13:49
  • 3
    Does this answer your question? [Grep in Mac OS X's terminal -- only displaying one color](https://superuser.com/questions/419467/grep-in-mac-os-xs-terminal-only-displaying-one-color) – harrymc Mar 19 '22 at 14:50
  • Thanks, but still not working. – Miguel Mar 19 '22 at 15:01

0 Answers0