如何从 Mac 上的 $PATH 中删除条目 [英] How to remove entry from $PATH on mac
问题描述
我尝试安装 Sencha Touch SDK 工具 2.0.0,但无法正常运行.它在 $PATH 变量中创建了一个条目.后来我删除了sencha sdk工具文件夹,但没有意识到路径变量仍然存在.
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
我得到 -
/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"
- Did
echo $PATH
显示/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
- 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屋!