I know I can get the locally assigned IP address of my current machine by the local router like so:
ifconfig
However, I want to know what my IP address is as visible from the outside world. Or, in other words, the IP address of the upper-most router within my private network. Normally I could just ask Google "my ip", but I want this to be scriptable.
Is there a way to figure out this address from CLI without just scraping the results of the above Google search?
netcat
worked for me perfectly. – Vombat Nov 25 '13 at 19:25