CentOS 7.4 shell 不显示当前用户和路径的问题时间:2023-03-09 21:24:32 步骤如下: vim ~/.bash_profile (不用管.bash_profile这个文件有几个,自己新建一个也是可以的) 在最后加上 export PS1='[\u@\h \W]\$' 然后执行 source ~/.bash_profile 这样shell就可以显示路径了 你也可能是不小心删除了/home下的文件,参考这里:http://blog.****.net/yhao2014/article/details/46237483