Thursday, December 13, 2012

Highlighting grep results

Speaking of highlighting, to highlight grep results add "--color".

To preserve the color when piping through less, two things: To grep add "--color=always" and to less add "-R"

I added aliases to .bashrc
alias less='less -R'
alias grep='grep --color=always'

$ grep if *java|less


No comments:

Post a Comment