Advertisement
Advertisement


editing PATH variable on mac


Question

How to edit PATH variable on mac (Lion). I cannot find any file where I can add paths. can someone guide me about it?

Whats the file name? .profile or .bash_profile???

and where I can find it? I have tried

echo 'export PATH=/android-sdk/tools:$PATH' >> ~/.profile
2011/10/09
1
79
10/9/2011 11:08:27 AM


Based on my own experiences and internet search, I find these places work:

/etc/paths.d

~/.bash_profile

Note that you should open a new terminal window to see the changes.

You may also refer to this this question

2017/03/20

You could try this:

  1. Open the Terminal application. It can be found in the Utilities directory inside the Applications directory.
  2. Type the following: echo 'export PATH=YOURPATHHERE:$PATH' >> ~/.profile, replacing "YOURPATHHERE" with the name of the directory you want to add. Make certain that you use ">>" instead of one ">".
  3. Hit Enter.
  4. Close the Terminal and reopen. Your new Terminal session should now use the new PATH.

-> http://keito.me/tutorials/macosx_path

2011/10/09

environment.plst file loads first on MAC so put the path on it.

For 1st time use, use the following command

export PATH=$PATH: /path/to/set
2017/03/03

use

~/.bash_profile

or

~/.MacOSX/environment.plist

(see Runtime Configuration Guidelines)

2017/03/03

Source: https://stackoverflow.com/questions/7703041
Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Email: [email protected]