title: Find internal IP address with BASH
body: <p>I am already aware of many ways of getting your internal IP (ifconfig, ip addr, /etc/hosts, etc), but I am trying to write a bash script that will always return the internal IP. The problem is, many one-liners (/sbin/ifconfig|grep inet|head -1|sed 's/\:/ /'|awk '{print $3}') can return multiple IPs, and I need to distinguish the internal one manually. </p>
  
  <p>I suspect that to the computer, there is no difference between and an external IP and an internal IP, and thus no 100%, guaranteed way to get the right IP. </p>
  
  <p>The end result is that this script will return the internal IP, no matter if its a 192 address or a 204 address, etc. </p>
  
  <p>Thanks in advance.</p>