Friday, August 4, 2017

grep just highlight

https://stackoverflow.com/questions/7393906/highlight-text-similar-to-grep-but-dont-filter-out-text#7394821

Trick is to use ^ to every line with a start-of-line. Since that's unprintable it won't get highlighted.

So to list all the files with arista in the name, but highlight the objects:

find . -name "*arista*" | grep -E '^|\.o|.so'