Skip to content

Instantly share code, notes, and snippets.

@greenbicycle
Last active May 5, 2016 18:49
Show Gist options
  • Save greenbicycle/a5c713932f7fcb3ddc2e to your computer and use it in GitHub Desktop.
Save greenbicycle/a5c713932f7fcb3ddc2e to your computer and use it in GitHub Desktop.
#!/bin/bash
# This will get the private networking address from a Digital Ocean droplet
# ifconfig | grep -C 1 eth1 | grep inet | awk -F' ' '{ print $2 }' | awk -F: '{ print $2 }'
# This will show all the ip addresses for this droplet
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment