Retrieve Your Public IP Address From The Command Line.
There are many reasons that you want to know your public IP address and getting that is easy by visiting some of the sites that allow you to view that information, but what if you wanted to do it from the command line? What if you wanted to script that? To upload the result to a web page? Or to email it?
There is a quick and easy way of doing it from the command line.
In Linux or any other UNIX based system, open terminal window or ssh to your server and type the following at the command prompt.
wget -qO - http://www.whatismyip.org
In Windows, if you haven’t done already, download and wget from this location, extract it to your c:\Windows or C:\Windows\system32 folder and then open a command line box and type the same command in the above in the command box.
On Linux/UNIX systems, curl http://www.whatismyip.org has the same result for the wget command above.

January 27th, 2009 at 9:22 pm
Great! Thank you!
I always wanted to write in my site something like that. Can I take part of your post to my site?
Of course, I will add backlink?
Regards, Timur I.
January 27th, 2009 at 10:27 pm
Of course, feel free.
Thank you for the comment.
February 5th, 2009 at 10:21 pm
Your site displays incorrectly in Explorer, but content excellent! Thank you for your wise words:)
February 15th, 2009 at 10:32 pm
Your web page does not correctly work in safari browser
February 16th, 2009 at 3:09 am
Content is tested on all browsers and is standard XHTML.
If you see the site not working in your browser, please feel free to email a screenshot of the page that is not rendering correctly along with your operating system information to the email address in the about page and I’ll check it again.
Thank you.
February 17th, 2009 at 6:06 am
Your are Great. And so is your site! Awesome content. Good job guys! Interesting article, adding it to my favourites!
May 5th, 2009 at 4:11 am
hm… bookmarked )
May 6th, 2009 at 12:33 am
now I’ll stay tuned..
June 3rd, 2009 at 12:16 am
Great post! Just wanted to let you know you have a new subscriber- me!
July 6th, 2009 at 8:14 pm
Hi. I like the way you write. Will you post some more articles?
February 11th, 2010 at 11:37 pm
Does not work in Win 7. I have imported the necessary file into the proper directory. The command goes through but nothing shows up, it goes back to the command line anyway. Emmm……
February 12th, 2010 at 1:30 am
Hi Rick,
Thanks for checking.
I tested it again, and it seems that the encoding of the “-” was morphed somehow into “–” and that is the cause of the problem.
Try it again, replace it with “-”, and it should work.
I just tested it on my Windows 7 64Bit ultimate computer.
February 12th, 2010 at 1:38 am
I have forced the character in the post, so you should be safe to copy/paste it now.
Thanks.
March 12th, 2010 at 5:00 pm
Foremost, let me commend your clarity on this subject. I am not an expert on this matter, but after studying your article, my understanding has improved substantially. Please allow me to snatch your rss feed to stay in touch with any upcoming updates. Complete job and will pass it on to admirers and my web site followers.
March 21st, 2010 at 6:31 am
Very good information.
April 11th, 2010 at 1:25 pm
This is a very fascinating post, I was looking for this info. Just so you know I found your weblog when I was doing research for blogs like mine, so please check out my site sometime and leave me a comment to let me know what you think.
April 15th, 2010 at 8:59 pm
Originality is the art of concealing your sources.