title: Where does <commandline> <arg> actually look on a Mac/OSX/MACOS?
body: <p>Generalist MACOS question.</p>
  
  <p>I'm trying to find the location of an executable I am being told to run. In order to run the file I type:</p>
  
  <p><code>postgres -V</code></p>
  
  <p>I am sure I have uninstalled this yet it still returns me a 'version'.</p>
  
  <p>I know that if I run a command then the terminal will look in the local folder which I'm in. But the file/executable for <code>postgres</code> is not in that folder. What other folders does mac look in? </p>
  
  <p>I know it will use <code>.bashrc</code> and <code>.bash_profile</code> to figure out a list of PATH's but apart from that I am unsure of the process OSX goes to to find executables.</p>
  
  <p>Can anyone shed any light on it? Or point me to documentation? I couldn't find what I wanted when I searched.</p>
  
  <p>Even better can I do some sort of command which tells me the location of that particular executable?</p>