title: Bash script to get all IP addresses
body: <p>I am trying to write a <code>bash</code> script to get all IP addresses on a server. The script should work on all major distros. Here is what I have:</p>
  
  <pre><code>ifconfig | grep 'inet addr:' | awk {'print $2'}
  </code></pre>
  
  <p>Resulting in:</p>
  
  <pre><code>addr:10.1.2.3
  addr:50.1.2.3
  addr:127.0.0.1
  </code></pre>
  
  <p>How can I first remove the <code>addr:</code> prefix? Second, how I can exclude <code>127.0.0.1</code>?</p>