Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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

share|improve this question
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" .. –  CraftyThumber Feb 13 '13 at 8:52
    
@CraftyThumber This should be an answer, and not just a comment. –  Mark Feb 15 '13 at 21:04
    
@MarkThalman OK, thanks, I put it as an answer. –  CraftyThumber Feb 16 '13 at 11:20
add comment

2 Answers

up vote 4 down vote accepted

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" . 
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.