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

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



 解决办法:

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

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



 



 

猜你喜欢

转载自sonicery-d.iteye.com/blog/2118037