1打開文件,添加如下一段話
vim ~/.bashrc
alias grep=
'grep --color'
2退出保存
source ~/.bashrc
只有執行grep命令搜索的時候,關鍵字就會有顏色了
也可以臨時查詢的時候,添加顏色
ps -ef | grep --color "timer"