今天偶然發現一個問題,在 grep 日志的過程中,搜出來一大坨但是被 grep 的那一段未高亮顯示,屬實有些難受,高亮顯示是 Linux 的高亮本來就是 Linux 的功能,與連接工具(我用的 xshell) 無關,記錄一下如何結解決:
1、隨便 grep 一下是否高亮顯示
發現並沒有按我們預期的,將被搜索的內容高亮;
2、查看一下 linux 配置 :cat ~/.bashrc:
# cat ~/.bashrc # .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi
3、將其修改:vi ~/.bashrc
這個文件主要保存個人的一些個性化設置,如命令別名、路徑等
# .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' alias grep='grep --color=auto' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi
4、保存(esc,:wq)
5、source ~/.bashrc
6、再試一下剛剛的 grep :
7、done