export PS1="\[$(tput bold)$(tput setb 4)$(tput setaf
7)\]\u@\h:\w $ \[$(tput sgr0)\]“
tput设置颜色的选项为:
- tput setab [1-7] -使用ANSI转义字符设置背景色。
- tput setb [1-7] -设置背景色
- tput setaf [1-7] --使用ANSI转义字符设置前景色。
- tput setf [1-7] --设置前景色。
tput设置文本的选项为:
- tput bold :黑体字模式
- tput dim:半透明模式
- tput smul :下划线模式
- tput rmul:退出下划线模型
- tput rev:打开反向模式
- tput smso :进入标准输出模式
- tput rmso:退出标准输出模式
- tput sgr0:关闭所有属性
tput的颜色代码:
- 0 – 黑色
- 1 – 红色
- 2 – 绿色
- 3 – 黄色
- 4 – 蓝色
- 5 – 紫色
- 6 – 青绿色
- 7 - 白色
No comments:
Post a Comment