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.
The <canvas>
element has been a revelation for the visual experts among our ranks. Canvas provides the means for incredible and efficient animations with the added bonus of no Flash; these developers can flash their awesome JavaScript skills instead. Here are nine unbelievable canvas demos that...
The hottest device out there right now seems to be the iPad. iPad this, iPad that, iPod your mom. I'm underwhelmed with the device but that doesn't mean I shouldn't try to account for such devices on the websites I create. In Apple's...
Every once in a while I find a tiny JavaScript library that does something very specific, very well. My latest find, Fokus, is a utility that listens for text selection within the page, and when such an event occurs, shows a beautiful modal dialog in...
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.