编辑/root/.bashrc

添加一行 alias grep = 'grep --color=auto'

随后 source ~/.bashrc 使之生效(永久)

也可以用变量方式: export GREP_OPTIONS='--color=auto'

但似乎仅限当前连接