如何在Mac上从$ PATH删除条目 [英] How to remove entry from $PATH on mac

查看:949
本文介绍了如何在Mac上从$ PATH删除条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装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 :

  1. 发出命令PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
  2. 显示了/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
  3. echo $PATH
  4. 发出命令export PATH
  5. 关闭终端,然后重新打开.给了命令echo $PATH.这次我得到了 /Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
  1. Gave the command PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
  2. Did echo $PATH which showed /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
  3. gave the command export PATH
  4. 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屋!

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