默認狀況下,Linux中的man
命令顯示結果是不帶顏色的,看起來交互性並很差。能夠添加一些配置,爲其添加一些顏色提示。linux
修改.bashrc
文件:vim
[root@localhost ~]# vim .bashrc
在文件最後加入以下配置:bash
# Set colors for man pages man() { env \ LESS_TERMCAP_mb=$(printf "\e[1;31m") \ LESS_TERMCAP_md=$(printf "\e[1;31m") \ LESS_TERMCAP_me=$(printf "\e[0m") \ LESS_TERMCAP_se=$(printf "\e[0m") \ LESS_TERMCAP_so=$(printf "\e[1;44;33m") \ LESS_TERMCAP_ue=$(printf "\e[0m") \ LESS_TERMCAP_us=$(printf "\e[1;32m") \ man "$@" }
保存退出,從新加載.bashrc
文件:ide
[root@localhost ~]# . !$
如今再去試試man
命令,發現它可愛多啦。spa
參考資料:code