简体   繁体   English

bash_profile 没有正常工作

[英]bash_profile not working as it should

Hi Im running linux angstrom distribution on a remote device, I added.bash_profile and.bashrc to /home/root since they didn't exist and I wrote this in them嗨,我在远程设备上运行 linux angstrom 发行版,我将 .bash_profile 和 .bashrc 添加到 /home/root,因为它们不存在,我在其中写了这个

PATH=/opt/qt-arm/lib:$PATH 
export PATH

But now when I login to this device and type $PATH I don't see the newly added path...Any Ideas??但是现在当我登录到这个设备并输入 $PATH 时,我没有看到新添加的路径......有什么想法吗?

I added.bash_profile and.bashrc to /home/root since...我将 .bash_profile 和 .bashrc 添加到 /home/root 因为...

Look in /etc/passwd to check whether /home/root is actully root's home directory.查看/etc/passwd以检查/home/root是否实际上是 root 的主目录。 On most linux distributions, it is just /root , not /home/root .在大多数 linux 发行版中,它只是/root ,而不是/home/root

Update in response to comments:更新回应评论:

.bash_profile and .bashrc are only inspected if the user's shell is bash . .bash_profile.bashrc仅在用户的 shell 为bash时才会被检查。 You can see what root's shell is in /etc/passwd .您可以在/etc/passwd中看到 root 的 shell 是什么。

Usually the home directory of the root account is /root (not in /home/root/ ).通常 root 帐户的主目录是/root (不在/home/root/ )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM