<p>What is the proper way to modify environment variables like PATH in OS&nbsp;X?</p>

<p>I've looked on Google a little bit and found three different files to edit:</p>

<ul>
<li>/etc/paths</li>
<li>~/.profile</li>
<li>~/.tcshrc</li>
</ul>

<p>I don't even have some of these files, and I'm pretty sure that <em>.tcshrc</em> is wrong, since OS&nbsp;X uses bash now. Where are these variables, especially PATH, defined?</p>

<p>I'm running <a href="http://en.wikipedia.org/wiki/Mac_OS_X_Leopard" rel="noreferrer">OS&nbsp;X&nbsp;v10.5</a> (Leopard).</p>

Up to and including
OS X v10.7
(Lion)
you can set them in:
```
```
~/.MacOSX/environment.plist
```
```
See:
https://developer.apple.com/legacy/library/qa/qa1067/_index.html
https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html
For PATH in the Terminal, you should be able to set in
```
.bash_profile
```
or
```
.profile
```
(you'll probably have to create it though)
For
OS X v10.8
(Mountain Lion) and beyond
you need to use
```
launchd
```
and
```
launchctl
```
.