Get IP Address from Command Line
Over the past few years I've needed to look up my IP address a dozen times. What's funny is that I don't recall why I needed it, I just did. So what's the easiest way to get my IP address from the command line?
To get your internal IP, you can do the following:
ipconfig getifaddr en0
I go through ipecho.net to get it:
curl ipecho.net/plain ; echo
# >> 71.87.32.78
Why go through an external resource? Your local address and your external address aren't the same, so using the external resource is the best way to tell what the world is seeing your IP address as.
![Chris Coyier’s Favorite CodePen Demos]()
David asked me if I'd be up for a guest post picking out some of my favorite Pens from CodePen. A daunting task! There are so many! I managed to pick a few though that have blown me away over the past few months. If you...
![Create Namespaced Classes with MooTools]()
MooTools has always gotten a bit of grief for not inherently using and standardizing namespaced-based JavaScript classes like the Dojo Toolkit does. Many developers create their classes as globals which is generally frowned up. I mostly disagree with that stance, but each to their own. In any event...
![Skype-Style Buttons Using MooTools]()
A few weeks back, jQuery expert Janko Jovanovic dropped a sweet tutorial showing you how to create a Skype-like button using jQuery. I was impressed by Janko's article so I decided to port the effect to MooTools.
The XHTML
This is the exact code provided by...
![Duplicate the jQuery Homepage Tooltips]()
The jQuery homepage has a pretty suave tooltip-like effect as seen below:
The amount of jQuery required to duplicate this effect is next to nothing; in fact, there's more CSS than there is jQuery code! Let's explore how we can duplicate jQuery's tooltip effect.
The HTML
The overall...
I prefer the slightly simpler/easier to remember
ipinfo.io can give you even more information and is easier to use via tunneling as it works without a host header.
Windows users can use
ipconfig
(notice the ‘p’).Your internal IP also depends on interface you’re using, in your case (en0) it was ethernet, but it also can be WiFi (en1).
Some time ago I started using an alternative which only uses DNS queries:
Google > “My IP” = Winner!
See http://ipinfo.io/developers for more details
I just search Google for “what is my ip” like a n00b.
I prefer:
hahaha, i just think to google it :D, but thanks dude, sometimes need to apply to my terminal command
It is ugly. But the Google lovers will enjoy.
Prerequisite: curl, and grep.