Skip to content

Instantly share code, notes, and snippets.

View zmarffy's full-sized avatar

Zeke Marffy zmarffy

  • USA
  • 06:14 (UTC -04:00)
  • Instagram zmarffy
View GitHub Profile
@zmarffy
zmarffy / displayip.sh
Last active May 23, 2020 18:00
Display public and private IPs of your machine
echo "Hostname is: $(hostname)"
echo "Public IP address is: $(dig +short myip.opendns.com @resolver1.opendns.com)"
echo "Private IP addresses are: $(hostname -I | sed 's/ /, /g' | sed 's/.\{2\}$//')"