Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove entry from $PATH on mac

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.

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

I searched on how to remove variables from $PATH and followed these steps :

  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?

like image 461
Tushar Koul Avatar asked Apr 08 '13 06:04

Tushar Koul


People also ask

How do I remove a path?

Click and drag the layer to the bottom of the Paths palette, right over the "Delete current path" button. This button is on the very bottom right side of the Paths palette and is represented by a picture of a trash can.

Where are my path variables Mac?

How do I find the PATH variable on a Mac? To find the PATH variable on Mac, open a terminal window and run echo $PATH. After which, the shell will return a list of all the directories currently listed under the PATH environment variable on your Mac.


2 Answers

  1. echo $PATH and copy it's value
  2. export PATH=""
  3. export PATH="/path/you/want/to/keep"
like image 69
user3890550 Avatar answered Sep 25 '22 06:09

user3890550


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.

like image 28
Ansgar Wiechers Avatar answered Sep 25 '22 06:09

Ansgar Wiechers