3

I'm running OS 10.8. When I

echo $PATH

my terminal outputs

/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/texbin:/Users/austinzuffi/Development/Android/adt-bundle-max-x86_64/sdk/tools

and i want to remove or at least edit

/Users/austinzuffi/Development/Android/adt-bundle-max-x86_64/sdk/tools

I can't find out where that string is entered. My /etc/paths shows

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

I'm assuming there's a file such as .bashrc that adds the entry upon login. I just can't find out which file is doing it. If you know which files might append my path environment variable, please let me know so I can check!

Also, if eclipse is modifying the system variable, let me know. I'm assuming eclipse doesn't have that power however I'm new to it.

Thanks guys -Austin

  • 2
    Look in ~/.profile, ~/.bashrc, ~/.bash_profile, /etc/bashrc. If any of those files contain a line starting with either source or . (which is short for source) then look in the sourced files too. Quicker might be to use grep. Open a terminal and, from your home directory run grep -r "/Users/austinzuffi/Development/Android/adt-bundle-max-x86_64/sdk/tools" .. – sjbx Feb 13 '13 at 8:52
  • @CraftyThumber This should be an answer, and not just a comment. – Ɱark Ƭ Feb 15 '13 at 21:04
4

Look in ~/.profile, ~/.bashrc, ~/.bash_profile, /etc/bashrc for a line of the following form:

export PATH=$PATH:/Users/austinzuffi/Development/Android/adt-bundle-max-x86_64/sdk/tools

Also look to see if any of those files contain a line starting with either source or . (which is short for source). If they do then look in the sourced files too.

A quicker way might be to use grep. Open a terminal and, from your home directory run

grep -r "/Users/austinzuffi/Development/Android/adt-bundle-max-x86_64/sdk/tools" . 
  • grep a quicker way?! If you really don't know where it could be, this approach will take a lot of time. Do you know how long it takes grep to search through a 500GB hard drive? Long. In terms of certainty grep is the best choice, but not speed. – Julian F. Weinert Dec 28 '14 at 7:02
  • And HDs are bigger these days ;) – Julian F. Weinert Dec 28 '14 at 7:03
0

You can take a look at this Superuser article for information about OS X path stuff. Of particular interest are the files in /etc/paths.d/ and ~/.bash_profile and the like.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .