Skip to content

Instantly share code, notes, and snippets.

@james-see
Last active December 30, 2021 19:16
Show Gist options
  • Save james-see/b5f50837b6211fa496ac78073aae8646 to your computer and use it in GitHub Desktop.
Save james-see/b5f50837b6211fa496ac78073aae8646 to your computer and use it in GitHub Desktop.
get just the bare public ip 4 address for eth0 on any VPS (tested on digital ocean and OVH Ubuntu 20.04)
ip a | grep eth0 | cut -d " " --fields=6 | sed '2q;d' | awk -F'/' '{print $1}'
# curl -L https://cutt.ly/UUYcT1r | /bin/bash
@james-see
Copy link
Author

curl -L https://cutt.ly/UUYcT1r | /bin/bash for brevity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment