As long as you have wget or curl installed, this should work:

1
wget http://ipinfo.io/ip -qO -
  • -q – quiet mode
  • -O – – output to standard output

Or you could use cURL with the following command:

1
curl http://icanhazip.com

:D