修改提示符格式
显示提示符
bash
[root@localhost ~]# echo $PS1
[\u@\h \W]\$
修改提示符
- 生产修改成红色
bash
cat >> /etc/profile.d/PS1.sh << EOF
PS1="\[\e[1;31m\][\u@\h \W]\\$\[\e[0m\]"
EOF
- 测试修改成绿色
bash
cat >> /etc/profile.d/PS1.sh << EOF
PS1="\[\e[1;32m\][\u@\h \W]\\$\[\e[0m\]"
EOF