Where to create a .profile on Mac OS X
You create .profile
in the same folder as .bash_profile
, namely in /Users/your-user-name/
also available under ~
or $HOME
.
You can add the line using a text editor or command line editor of your choice (like vim
, emacs
or nano
), but you can also do it with Text Edit:
open -a TextEdit ~/.bash_profile
Where to put the export
command?
One important thing: If you already have a .bash_profile
, your .profile
will not be loaded automatically. From bash's manual:
it looks for
~/.bash_profile
,~/.bash_login
, and~/.profile
, in that order, and reads and executes commands from the first one that exists and is readable.
Because of that, when you already have a ~/.bash_profile
file and create a ~/.profile
, the latter will never be read by bash automatically. You can add the appropriate export
command in your ~/.bash_profile
and it will work just fine if you always use bash:
export PATH=/usr/local/mysql/bin/:$PATH
Source .profile
from .bash_profile
If you want to have a separate .profile
, you need to manually include it from ~/.bash_profile
. Put the following in ~/.bash_profile
:
source ~/.profile
In Terminal:
open .profile
If that doesn't work, go to your home directory:
sudo nano .profile
and add:
export PATH=$PATH:/usr/local/mysql/bin/