I am using ubuntu 12.04. I tried to get my public IP address in command prompt. But, it shows only local ip. Is there any way to get public ip from command line.
you can also use the following by AWS:
curl checkip.amazonaws.com
You will need to have an external service provide your external IP.
curl ident.me
This works for me:
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
Source: https://askubuntu.com/questions/95910/command-for-determining-my-public-ip