Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
loudmax
· 3y ago · 0 comments
This is how I colorize with grep:
cat <file> | grep -E --color "<regex>|$"
Where `<regex>` is your pattern.
Comments
[–]
ralgozino
3y ago
adding "or an end of the line" to the regex is pretty clever, I'm stealing it :) thanks!
[–]
quickthrower2
3y ago
Obligatory “you don’t need cat”