Order of /usr/bin and /usr/local/bin and more in $PATH
<p>On my Mac I used bash a lot. For my environment settings I added <code>/usr/bin</code> and <code>/usr/local/bin</code> into <code>$PATH</code> as I normally did.</p>

<p>While I do know what <code>/usr/bin</code> and <code>/usr/local/bin</code> are about, I am curious which should go before another, by convention? And is there a specific reason for that?</p>

<p>Similar is for <code>/usr/lib</code> and <code>/usr/local/lib</code> -- hopefully the answer is the same or similar.</p>

<p> a bit more --
Just an extension of the original question, how would you order the following in $PATH following the convention and why?</p>

<pre><code>/bin
/sbin
/usr/bin
/usr/sbin
/usr/local/bin
/usr/local/sbin
/opt/local/bin
/opt/local/sbin
</code></pre>