使用ssh 在shell显示-bash-4.1$ 不显示路径解决方法

来源:互联网 发布:poi数据 编辑:程序博客网 时间:2024/04/30 13:21


近日,远程服务器升级了下,然后 .bashrc 及 .bash_profile文件被设置空文件了.


登录后发现:


ssh username@server_address-bash-4.1 $ 

没有了路径. 


想着估计是上面两个文件为空的原因. 

找了个帖子:http://hi.baidu.com/okyours/item/c39a4f9cb524538959146167

然后,修改了下 .bash_profile 文件,就可以了

$ vi .bash_profile
#export PS1='[\u@\h \W]\$ 'export PS1='[lucktroy@\h \W]\$ '

其中第一条中: \u 为 username, \h 为node name, \W 为当前路径

我自己将username设置成了"lucktroy".

效果如下:

[lucktroy@node01 ~]$ ls


原创粉丝点击