Oneliners for Getting the External IP Address in Bash

In this article I will show you a bunch of oneliners that return your external IP address.

One:
$ curl -s icanhazip.com

Two:
$ curl -s ip.appspot.com

Three:
$ curl -s whatismyip.org
OR:
$ wget -O - -q whatismyip.org

Four:
$ curl -s ifconfig.me

Sometimes you may need to get your IP address inside a bash script, so this commands are quite usefull.

Tagged with: , , , ,
Posted in The Linux and Unix Articles!
One comment on “Oneliners for Getting the External IP Address in Bash
  1. Jubei says:

    Excellent tips! Thank you.

Leave a Reply

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

*

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!