title: How to get the primary IP address of the local machine on Linux and OS X?
body: <p>I am looking for a command line solution that would return me the primary (first) IP address of the localhost, other than 127.0.0.1</p>
  
  <p>The solution should work at least for Linux (Debian and RedHat) and OS X 10.7+</p>
  
  <p>I am aware that <code>ifconfig</code> is available on both but its output is not so consistent between these platforms.</p>