Get public IP of current machine on terminal

curl checkip.amazonaws.com
curl ifconfig.me
curl icanhazip.com
curl ipecho.net/plain
curl ifconfig.co

## store output in $server_ip ##
server_ip="$(curl ifconfig.co)"

## Display it ##
printf "Server public ip4 %s\n" $server_ipCode language: Bash (bash)

Posted

in

, ,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.