vim ~/.bashrc ##添加以下信息 export PS1='[\u@\h `pwd`]$ ' 然后保存退出 source ~/.bashrc 或者关机重新启动即可 转载于:https://www.cnblogs.com/students/p/8821541.html