Updating the system PATH variable on OS X

Some command-line tools for OS X will require you to add a new directory of base executables to your system path. Below, I'll outline the process of adding the directory /usr/local/bin to the system PATH variable.

First, you'll need to edit the ~/.bash_profile file, or create it if it doesn't exist already.

$ sudo vi ~/.bash_profile

Once the file is open, add the following line.

export PATH=/usr/local/bin:$PATH

After saving the file, run the following command to make sure ~/.bash_profile is executed.

$ source ~/.bash_profile

more OS X posts