步驟如下:
vim ~/.bash_profile
(不用管.bash_profile這個文件有幾個,自己新建一個也是可以的)
在最后加上
export PS1='[\u@\h \W]\$'
然后執行
source ~/.bash_profile
這樣shell就可以顯示路徑了
你也可能是不小心刪除了/home下的文件,參考這里:http://blog.csdn.net/yhao2014/article/details/46237483
