0
votes
1answer
119 views

Using Grep Colour to look in a file, and output with a coloured answer in amongst the file contents

I am currently in the process of writing a program in raspberry pi that will allow me to look inside files and have what I entered displayed in colour I think I need to do something to do with ...
6
votes
3answers
239 views

cascaded grep matches color code as pattern

I am piping output of one grep comand into another grep. The first grep is using --color=always, so that the first match is colored. In practice, that means that the match is enclosed between two ...
9
votes
2answers
431 views

Filter output of command by color

I am running a utility that doesn't offer a way to filter its output. Nothing in the text of the output indicates that a particular function failed but it does show in red. The output is so long that ...
7
votes
2answers
315 views

Using empty line as context “group-separator” for grep

I need grep output with context, in color, and blank lines as group separator. In this question, I learned how to define custom group-separator, and I have constructed my grep command like this: grep ...
4
votes
1answer
922 views

How can I keep color codes with grep input?

It I grep something twice: ... | grep foo | grep bar It seems foo is not highlighted. Infact, it seems grep removes colorcodes from its input; Any way to prevent this?
1
vote
1answer
839 views

Sorting by one column then the

Say i have a output file with following: 010513 08:04 ROUTER1 192.168.1.1 68.130.5.10 HIT(1) 010513 08:04 ROUTER1 172.168.1.1 28.130.5.10 HIT(1) 010513 08:04 ROUTER1 122.168.1.1 ...
8
votes
3answers
2k views

Mark occurrences of keyword with a different color

I have a program which spits out an output to stdout like: [OK] Something is ok [OK] Something else is also ok [FAIL] This does not look good [FAIL] Neither does this [OK] At ...
6
votes
1answer
752 views

grep --color adds ANSI code ESC[K - This can change displayed text

Why does grep add ANSI code \e[K to its colored output? I can't see the point of it, but obviously the developers can. It is an ANSI/VT100 Terminal code which is used to "Clear line from current ...
6
votes
3answers
2k views

Grep_color on mac

I am trying to get my regex highlighted on mac using terminal. I have put this is my .profile: export GREP_COLOR='1;30;40' Nothing changes, so I added the same to my bash.profile still nothing, ...
3
votes
1answer
1k views

git grep colors differ from grep custom colors

I've setup grep colors in my ~/.bashrc : export GREP_COLORS='ms=01;34:mc=01;34:sl=:cx=:fn=35:ln=32:bn=32:se=36' They work for grep --color=auto grep --color=always Unfortunately, those custom ...
17
votes
6answers
869 views

How can I highlight matches using GNU grep?

I have seen on some Linux, that grep is configured to highlight the match, and print the matching file. How can I configure grep to highlight matches?