For years I've noticed GNU's grep in Unixes (not just Linux flavors) detected that I was using a color-capable TERM interactively like xterm/gnome-terminal/kconsole, and nicely colored my search expressions among the context.

What might be a simple cli tool that only boldens/highlights your regex or simple search string, but unlike grep, doesn't otherwise filter out any lines? Maybe a sed trick can do this, which I can alias and later pipe commands to?

EXAMPLE

So I wrote a program pricehist.sh which normally produces CSV-like data for another program, but I frequently visually inspect it like so:

less can do this, but (I don't think) you can pipe data through. It sounds like you have a typical use case in mind. It might help if you post some sample input, and expected output to get everyone thinking about your problem in a helpful way. Good luck.
–
shellterFeb 22 '12 at 16:42

True, less nicely colors except I need it just to print w/highlighting and terminate, not wait for user interaction eg. paging or quitting--which then clears its output. Unless it has some option I'm not aware of. Use case: I tail -F tons of log files in one console to watch activity in realtime
–
MarcosFeb 22 '12 at 17:16

Thanks; that did come to mind, however didn't like having to use the 9999 arbitrarily large number of lines (hoping the stdin would run out long before that). Also there's the issue of trying to avoid buffering as much as possible for near-realtime output
–
MarcosFeb 22 '12 at 17:22

Just switched your single-quotes to double so that the shell would take my variable as search pattern: | sed "s/$(date +%Y%m%d)/\x1b[01;31m&\x1b[0m/g" and that put out the itch. Thanks!
–
MarcosFeb 22 '12 at 17:58

++ Great tool I use all the time. Except I use / or ? + Enter ,repeat search, for seeking fwd/back so my lazy fingers don't have to move much. Didn't know about the Ctrl-r, no wonder I became so friendly with the `\` key
–
MarcosFeb 22 '12 at 17:46