How to configure $PATH (for LaTeX) and run commands in Terminal? After consulting the programming section of StackExchange, I have been referred to apple.stackexchange instead.

I am using the following template: http://www.latextemplates.com/template/masters-doctoral-thesis.

The associated forum (http://www.latextemplates.com/forums#/categories/masters-doctoral-thesis) suggests that I should run the following commands to solve a coding issue:


latex article.tex  
bibtex article  
latex article.tex
latex article.tex


I know I run commands with Terminal.app and I assume I can copy/paste the coding above into Terminal, given that LaTeX is in my $PATH. My questions are, (1) What is the $PATH and (2) how do I configure it to include LaTeX? 

Thanks!

Best,

LJR

PS: I am using TeXShop. 
PPS: I am new to coding and LaTeX.
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).