个性化Shell命令提示符及颜色
一键命令
echo "PS1='\[\e[1;32;40m\][\t \u@\h \W]\$ \[\e[0m\]'" >> ~/.bashrc && source ~/.bashrc先贴个我的配置:
PS1='\[\e[1;32;40m\][\t \u@\h \W]\$ \[\e[0m\]'显示样式:
[11:14:57 root@centos7 /]#其他样式:
PS1='\[\e[1;32;40m\][\u@\h:\t \W]\$ \[\e[0m\]'显示样式:
[root@centos7:11:11:25 ~]$ Shell命令提示符及颜色是由.bashrc里面的PS1环境变量控制的,所以我们修改PS1即可。