让你的man手册显示与众不同

Linux中默认的man帮助页面是黑白的,如果将其改成彩色的会更便于阅读。由于man page的显示默认是通过less来完成的,故在.bashrc文件中添加less的相关设置参数即可令man page输出信息变成彩色的,在.bashrc文件中加入如下内容:
export LESS_TERMCAP_mb=$'E[01;31m'
export LESS_TERMCAP_md=$'E[01;31m'
export LESS_TERMCAP_me=$'E[0m'
export LESS_TERMCAP_se=$'E[0m'
export LESS_TERMCAP_so=$'E[01;44;33m'
export LESS_TERMCAP_ue=$'E[0m'
export LESS_TERMCAP_us=$'E[01;32m'
source .bashrc 直接生效

重启启动终端即可。

可以直接:man termcap查看帮助文件:其中常用的主要是上边列写的那几个,具体含义:

mb start blink
md start bold
me turn off bold, blink and underline
us start underline
ue stop underline
so start standout
se stop standout

'E[01;44;33m'中:用;将其分为3组,第一组主要表示是否加粗,第二组主要是前景色,第三组主要是背景色;

x代表是否加粗,1为加粗,0为正常;4433分别代表文字前景色和背景色,

$后是具体你想要的颜色,具体:

经常用数字 1  2  3  4  5  6  7来代替

原文地址:https://www.cnblogs.com/guochaoxxl/p/6823135.html