Debian $ PATH变量更改 [英] Debian $PATH variable change

查看:902
本文介绍了Debian $ PATH变量更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Debian中更改$ PATH变量?我试图改变 / etc / profile ,但这只会影响普通用户(是的,我添加了BOTH用户和root用户的路径)



之后,我尝试编辑 /root/.profile 然后 /root/.bashrc 还...



没有任何工作。你知道哪里可能是问题吗?

解决方案

这是在debian 6.0的/etc/login.defs中设置的。 p>

这些是您必须编辑的行:

 #*需要*默认PATH设置,适用于超级用户和普通用户。 

#(它们最小,在shell启动文件中添加其余的)
ENV_SUPATH PATH = / usr / local / sbin:/ usr / local / bin:/ usr / sbin: / usr / bin:/ sbin:/ bin
ENV_PATH PATH = / usr / local / bin:/ usr / bin:/ bin:/ usr / local / games:/ usr / games

编辑:



我忘了放在那里我找到了解决方案: https://serverfault.com/questions/ 166383 / how-set-path-for-all-users-in-debian


How can I change the $PATH variable in Debian? I tried to change /etc/profile but this affected only normal users (and yes, I added path to BOTH user's and root's paths).

After that I tried to edit /root/.profile and then /root/.bashrc also ...

Neither worked. Do you know where could be problem?

解决方案

This is set in the /etc/login.defs on debian 6.0 .

These are the lines you have to edit:

# *REQUIRED*  The default PATH settings, for superuser and normal users.
#
# (they are minimal, add the rest in the shell startup files)
ENV_SUPATH      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV_PATH        PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

EDIT:

I forgot to put where I found the solution: https://serverfault.com/questions/166383/how-set-path-for-all-users-in-debian

这篇关于Debian $ PATH变量更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆