终端连接服务器,不执行.bash_profile

来源:互联网 发布:免费指标编程视频教程 编辑:程序博客网 时间:2024/06/05 18:42

最近头儿给创建了一个用户,我打算在自己的家目录下.bash_profile需要修改PATH,结果重新登录,发现路径并没有添加成功。即登陆shell并没有执行.bash_profile.

问题解决: echo $SHELL  首先查看自己使用的shell版本。自己一看才知道是/bin/sh。这样当然在.bash_profile中修改不成功了

╮(╯▽╰)╭。。。

解决办法:修改用户shell  usermod -s /bin/bash  xxxx

扩展知识:

注:以bash为例。登陆shell 执行/etc/profile ~/.bash_profile  非登陆shell 只执行~/.bashrc。

bash:

/etc/profile

         ~/.bash_profile  是交互式、登陆shell执行

         ~/.bashrc          是交互式、非login shell执行

ksh:

/etc/profile

~/.profile

~/.kshrc

csh:

/etc/.login

~/.login

~/.cshrc

原创粉丝点击