0

I am looking for a FLOSS tool for the Linux terminal that acts similar to grep, but it should output everything, not just matching lines. But the twist is that the matching terms should be colorized (preferably configurable).

In short, I am looking for a grep --color PATTERN FILE... on lines with matches and uncolored output for every line without a match.

Doesn't matter if the suggested software is a script or compiled to a binary.

1

From this answer on U&L SE:

Use ack / ack-grep:

ack --passthru --color string file

or ripgrep:

rg --passthru pattern file.txt

You can also achieve the same using grep:

grep --color -E "test|$" yourfile
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.