Skip to content

Instantly share code, notes, and snippets.

@surendharreddy
Created January 12, 2021 09:34
Show Gist options
  • Select an option

  • Save surendharreddy/3bc601597fa5fa43d858676d337da585 to your computer and use it in GitHub Desktop.

Select an option

Save surendharreddy/3bc601597fa5fa43d858676d337da585 to your computer and use it in GitHub Desktop.
Get my internal and external IP
findme () {
echo "Internal IP: $(ifconfig en0 inet | grep inet | awk '{print $2}')"
echo "External IP: $(dig @resolver4.opendns.com myip.opendns.com +short)"
}
findme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment