Latest Macs use zsh shell.
Many solutions to adding to the path involve updating the .bash_profile file for bash shell.
I found this to be the simplest solution:
It turns out there is a very neat way to do this in OS X, the
/etc/paths file! The file contains a list (one per line) of paths that are added to the
$PATH variable in the shell. Here are some quick directions to add to the path:
- Open up Terminal.
- Run the following command:
sudo nano /etc/paths
- Enter your password, when prompted.
- Go to the bottom of the file, and enter the path you wish to add.
- Hit control-x to quit.
- Enter “Y” to save the modified buffer.
- That’s it! To test it, in new terminal window, type: