How to remove entry from $PATH on mac

前端 未结 7 1613
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-22 16:44

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 b

相关标签:
7条回答
  • 2020-12-22 17:25

    Close the terminal(End the current session). Open it again.

    0 讨论(0)
  • 2020-12-22 17:27

    Check the following files:

    /etc/bashrc
    /etc/profile
    ~/.bashrc
    ~/.bash_profile
    ~/.profile
    ~/.MacOSX/environment.plist
    

    Some of these files may not exist, but they're the most likely ones to contain $PATH definitions.

    0 讨论(0)
  • 2020-12-22 17:27

    Use sudo pico /etc/paths inside the terminal window and change the entries to the one you want to remove, then open a new terminal session.

    0 讨论(0)
  • 2020-12-22 17:29

    On MAC OS X Leopard and higher

    cd /etc/paths.d
    

    There may be a text file in the above directory that contains the path you are trying to remove.

    vim textfile //check and see what is in it when you are done looking type :q 
    //:q just quits, no saves
    

    If its the one you want to remove do this

    rm textfile //remove it, delete it
    

    Here is a link to a site that has more info on it, even though it illustrates 'adding' the path. However, you may gain some insight.

    0 讨论(0)
  • 2020-12-22 17:31
    1. echo $PATH and copy it's value
    2. export PATH=""
    3. export PATH="/path/you/want/to/keep"
    0 讨论(0)
  • 2020-12-22 17:39

    when you login, or start a bash shell, environment variables are loaded/configured according to .bashrc, or .bash_profile. Whatever export you are doing, it's valid only for current session. so export PATH=/Applications/SenchaSDKTools-2.0.0-beta3:$PATH this command is getting executed each time you are opening a shell, you can override it, but again that's for the current session only. edit the .bashrc file to suite your need. If it's saying permission denied, perhaps the file is write-protected, a link to some other file (many organisations keep a master .bashrc file and gives each user a link of it to their home dir, you can copy the file instead of link and the start adding content to it)

    0 讨论(0)
提交回复
热议问题