今天在centos中由超级用户切换到普通用户时发现shell中显示的是“bash-4.1$”而不是正常的用户名+路径。现象如下:


centOS中切换到普通用户shell显示bash-4.1$
 解决办法:

1、打开~/.bash_profile文件并在其中添加export PS1='[\[email protected]\h \W]\$'

2、执行source ~/.bash_profile编译文件 确认修改生效


centOS中切换到普通用户shell显示bash-4.1$
 


centOS中切换到普通用户shell显示bash-4.1$
 

 

相关文章: