bash_profile不能正常工作

时间:2012-04-07 15:23:54

标签: linux path environment-variables

我正在远程设备上运行linux angstrom发行版,我将.bash_profile和.bashrc添加到/ home / root,因为它们不存在而且我在其中写了

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

但是现在当我登录这个设备并键入$ PATH时,我没有看到新添加的路径...任何想法?

2 个答案:

答案 0 :(得分:3)

  

我将.bash_profile和.bashrc添加到/ home / root,因为...

查看/etc/passwd以检查/home/root是否是actully root的主目录。在大多数Linux发行版中,它只是/root,而不是/home/root

回复评论时更新:

仅当用户的shell为.bash_profile时才会检查

.bashrcbash。您可以在/etc/passwd中查看root的shell。

答案 1 :(得分:1)

通常,root帐户的主目录为/root(不在/home/root/中)。