Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

editing PATH variable on mac [closed]

Tags:

macos

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 
like image 266
coure2011 Avatar asked Oct 09 '11 11:10

coure2011


2 Answers

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

like image 37
can. Avatar answered Oct 10 '22 10:10

can.


Open and edit /etc/paths using any text editor.

$ sudo vi /etc/paths 

(editing text files with vi)

Note: each entry is separated by a new line

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

Save and close the file. Then restart your terminal.

like image 104
Ryan Allen Avatar answered Oct 10 '22 08:10

Ryan Allen