commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
looks for IPs at the beginning of the line or prefixed by a space
also shows the ethernet adapter
May be useful to get user's ip address over the phone, as users struggle to read through a long ipconfig result.
Get your ip address, hostname, ASN and geolocation information. If you want just one field as a text response you can also get that,eg curl ipinfo.io/ip
Returns your external IP address to the command line using only wget
shorter (thus better ;-)
Plain Text Ip Output, independent of Layout change.
Gets your IP address and has a shorter URL.
looks at html for "ip" (it's a CSS class), then a little of cut and egrep to get IPv4 address.
I use this oneliner into conky.
Instead of hard-coding in a check to scrape info from ifconfig based on a specific interface, do it in a more portable way.
This works really well if you switch between wired, wireless, bluetooth or even VPN connections. You can get your current IP in a script (since it'll be something like tun0 instead of eth0 or wlan1).
This uses a well known public ip address 22.214.171.124, but it doesn't actually connect to it, it just shows you the route it would take.
Short list of all ip.
Shows even the newly supported multiple ip address on the same interface (see eth1).
For ipv6 use -6
Asks Google what your current IP address is. Bonus: Remove "@ns1.google.com" and you will instead get the IP address of your DNS server.
That's the easiest way to do it. -I (or capital i) display all network addresses of a host