curl ifconfig.me

One little trick I like to use in Linux and Mac OS X is when I want to know the external IP address of the machine I am working on is to use curl along with a website called ifconfig.me.

We can begin with something very easy to get the external IP address we need to open your favorite terminal and issue this command:

curl ifconfig.me

Pretty simple right? Well you can take if even farther and create scripts to call for more options such as: Remote Hosts, Port, and User Agent, all of these options depend on ifconfig.me’s website, so for example that I wanted to get the Remote Host I would issue:

curl ifconfig.me/host
Tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.

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