This is the way I do it and I’m storing the info here because I’ve already looked it up on 3 different occasions.
I store them in my bash profile. To edit that file simply use the following in the terminal:
subl ~/.bash_profile
I use Sublime text editor. You can substitute nano or vm or the command for your preferred editor of choice.
You’ll see stuff like: export SOME_ENVIRONMENT_VARIABLE=”foo”, add whatever you need to add.
After you’ve made your changes you’ll probably want those changes to affect the terminal window you are currently working in. To do that type:
source ~/.bash_profile
Done.