When you type in a command, it looks in the PATH directories for the utility you want to use.
Suppose you wanted to run the utility `ls` and your PATH looked like this:
Code:
/usr/local/apache-maven-3.0.4/bin:/usr/local/homebrew/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/git/bin:/Users/seventwo/aspectj1.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin
It would look for the utility program ls in
/usr/local/apache-maven-3.0.4/bin
If it exists in that directory, it will run that program.
otherwise it will look into the next directory:
/usr/local/homebrew/bin
... so on and so forth. It goes through that list in order and will stop as soon as it finds the first program with the same name.
When you change your PATH variable, you typically just want to add some directory to it so you can run the utility program just by calling its name (, opposed to typing out the full location of the file).
Ex.
Appending /Users/seventwo/aspectj1.6/bin to my PATH variable allows me to run my AspectJ program by simply typing `aj` rather than `/Users/seventwo/aspectj1.6/bin/aj`
As you can see from my example, it is simply a matter of convenience. It typically doesn't screw things up unless you clutter your PATH variable with a ton of different directories.
DISCLAIMER: My example is catered more for Unix-like systems, but PowerShell has similar concepts... Syntax is going to be different with PowerShell.