Sunday, 1 January 2017

How to make grep highlight keyword with colors?

add option --color
e.g.
jtony@genoa:~/learn/shell/UserGuide$ grep -rn --color 'in[du]'  string2.txt
1:Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
2:Mozilla/4.75 [en](X11;U;Linux2.2.16-22 i586)

No comments:

Post a Comment