How to configure $PATH (for LaTeX) and run commands in Terminal?
The $PATH provides the shell (command line) a list of directories to look at for executables. So, when you type a command in the command line, the shell (the program running in the terminal) will look in the locations listed in your $ PATH for an executable matching the command. The first one it finds, it runs.

To see the information type echo $PATH on the command line. This should return something along the lines of:


/Users/name/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin


To add a new location to your path (i.e. /opt/local/bin )you issue a command such as


PATH=/opt/local/bin:"${PATH}"


This adds /opt/local/bin to your $PATH 

*Specifically it adds it first, so this will be the first place the shell will look for a command! This is important because if you have multiple copies of an executable you'll want to know which one is being executed.

BTW, Generally you will add your path command to your .bash_profile file (~/.bash_profile) that way it will set your $PATH as you desire overtime you laugh the  BASH shell (the default on OS X).