How do I get grep color in the file names before each match?
- by chimerical
If I run grep -ir "somethingtomatch" . from the current directory, I typically get results like this:
./some/path/file1.html: filecontent filecontent keyword filecontent
./some/path/file2.html: filecontent filecontent filecontent keyword
./some/path/file3.html: filecontent keyword filecontent filecontent
./some/path/file4.html: keyword filecontent filecontent filecontent
I used grep --color=auto -ir 'somethingtomatch" . but it only highlights the keywords in white on a red highlight. I'm trying to get file names on the left color-coded too. How do I do that?
I'm using Terminal.app in OS X with bash and xterm (and I tried xterm-color too).