[root@web01 ~]# tail -1 /etc/bashrc ##添加一下命令 alias grep='grep --color=auto' [root@web01 ~]# source /etc/bashrc ##source文件一下 [root@linux-node1 9_14]# cat 14_1.txt aa bb [root@linux-node1 9_14]# grep --color 'aa' 14_1.txt aa