如何在Mac上从$ PATH删除条目 [英] How to remove entry from $PATH on mac
问题描述
我试图安装Sencha Touch SDK工具2.0.0,但无法正常运行.它在$ PATH变量中创建了一个条目. 后来我删除了sencha sdk tools文件夹,但没有意识到path变量仍然存在.
I was trying to install Sencha Touch SDK tools 2.0.0 but could not run it properly. It created an entry in the $PATH variable. Later I deleted the sencha sdk tools folder but didn't realize that the path variable is still there.
当我做了echo $PATH
时,我得到了-
When i did echo $PATH
I got -
/Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
我搜索了如何从$ PATH中删除变量,并遵循以下步骤:
I searched on how to remove variables from $PATH and followed these steps :
- 发出命令
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
- 显示了
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
的 - 发出命令
export PATH
- 关闭终端,然后重新打开.给了命令
echo $PATH
.这次我得到了/Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
echo $PATH
- Gave the command
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
- Did
echo $PATH
which showed/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
- gave the command
export PATH
- Closed terminal and reopened it. Gave the command
echo $PATH
. This time I got/Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
有人可以告诉我我在做什么错吗?
Can anyone tell me what am i doing wrong?
推荐答案
您正在执行的操作对于当前会话有效(仅限于您正在使用的终端).您需要坚持这些更改.考虑将上述步骤1-3中的命令添加到您的${HOME}/.bashrc
.
What you're doing is valid for the current session (limited to the terminal that you're working in). You need to persist those changes. Consider adding commands in steps 1-3 above to your ${HOME}/.bashrc
.
这篇关于如何在Mac上从$ PATH删除条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!