vi ~/.bashrc

1 # .bashrc

3 # User specific aliases and functions

5 alias rm='rm -i'

6 alias cp='cp -i'

7 alias mv='mv -i'

8 export GREP_OPTIONS='--color=auto'

9 export GREP_COLOR='1;33'

10 

11 # Source global definitions

12 if [ -f /etc/bashrc ]; then

13         . /etc/bashrc

14 fi

source ~/.bashrc


可以在.bashrc里加上

export GREP_OPTIONS='--color=auto'

来实现高亮匹配,具体用什么颜色,可以通过

export GREP_COLOR='a;b' #默认是1;31,即高亮的红色

来设置,其中:

a:可以选择:【0,1,4,5,7,8】    b: 可选择:

0 关闭所有属性            30 black                  

1 设置高亮度              31 red

4 下划线                32 green

5 闪烁                  33 yellow

7 反显                  34 blue

8 消隐                  35 purple

                      36 cyan

                      37 white