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_ip
Code language: Bash (bash)
Get public IP of current machine on terminal
by
Leave a Reply