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.
With CSS border-radius, I showed you how CSS can bridge the gap between design and development by adding rounded corners to elements. CSS gradients are another step in that direction. Now that CSS gradients are supported in Internet Explorer 8+, Firefox, Safari, and Chrome...
My trip to Mozilla Summit 2013 was incredible. I've spent so much time focusing on my project that I had lost sight of all of the great work Mozillians were putting out. MozSummit provided the perfect reminder of how brilliant my colleagues are and how much...
The idea of image preloading has been around since the dawn of the internet. When we didn't have all the fancy stuff we use now, we were forced to use ugly mouseover images to show dynamism. I don't think you were declared an official...
"Copy to clipboard" functionality is something we all use dozens of times daily but the client side API around it has always been lacking; some older APIs and browser implementations required a scary "are you sure?"-style dialog before the content would be copied to clipboard -- not great for...
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.