title: ip and mac address linux
body: <p>I want to get the ip-address and mac-address as output in linux terminal.</p>
  
  <p>I don't want 'addr' before the ip-address.
  The mac-address needs to be in this form: <code>000C29DDED7C</code> (without ':' and all in capitals)</p>
  
  <p>I tried this:</p>
  
  <pre><code>echo "ip-address: `/sbin/ifconfig | head -2 | grep 'inet ' | tr -s ' ' | cut -d' ' -f3` mac-address: `/sbin/ifconfig | head -1 | tr -s ' ' | cut -d' ' -f5 | tr ':' ' ' | tr 'a-z' 'A-Z'`"
  </code></pre>
  
  <p>Gives me:</p>
  
  <pre><code>ip-address: addr:192.168.8.141 mac-address: 00 0C 29 AC 3C 02
  </code></pre>