遇到问题:切换到用户user的时候,出现-bash-4.2$,正常情况下应该是用户名@主机名
例如:[user@pgsql-slave ~]$
原因:用户user的家目录下文件丢失导致,缺少下面2个文件
.bash_profile
.bashrc
Linux系统使用useradd创建新用户时,系统会将所有的配置文件从/etc/skel/目录下复制到新用户家目录下,例如:/home/user下面,注意文件是隐藏的,使用ls -la #查看隐藏文件
解决办法:
1、切换到有故障的用户
su - user
2、复制/etc/skel 里面的模板到当前用户
cp /etc/skel/.bash* ~
ls -la
3、重新登录
exit
su - user
至此,CentOS-7.x终端界面变成-bash-4.2$解决办法教程完成。

» 转载请注明来源:系统运维 » CentOS-7.x终端界面变成-bash-4.2$解决办法


