Mac OS X
- Open the
.bash_profile
file in your home directory (for example,/Users/your-user-name/.bash_profile
) in a text editor. - Add
export PATH="your-dir:$PATH"
to the last line of the file, where your-dir is the directory you want to add. - Save the
.bash_profile
file. - Restart your terminal.
Linux
- Open the
.bashrc
file in your home directory (for example,/home/your-user-name/.bashrc
) in a text editor. - Add
export PATH="your-dir:$PATH"
to the last line of the file, where your-dir is the directory you want to add. - Save the
.bashrc
file. - Restart your terminal.