2013年1月9日 星期三

linux grep color setting


1. Solution
alias grep_gray="GREP_COLOR='1;30' grep --color=always"
alias grep_red="GREP_COLOR='1;31' grep --color=always"
alias grep_green="GREP_COLOR='1;32' grep --color=always"
alias grep_yellow="GREP_COLOR='1;33' grep --color=always"
alias grep_blue="GREP_COLOR='1;34' grep --color=always"
alias grep_magenta="GREP_COLOR='1;35' grep --color=always"
alias grep_cyan="GREP_COLOR='1;36' grep --color=always"

2. Example
echo hello there | grep_magenta ll | grep_yellow ere
hello there



Reference:
detail
linux color tutorial

沒有留言:

張貼留言