I hope you know about the possibility to find out your IP Address by using visiting the site http://www.whatismyip.com . I needed a way to check this from the command line and this is what I came up with:

For this, you need the packages wget, grep and sed so make sure you have them by checking for them in Synaptic or running the following in a terminal:
Code:
sudo apt-get install wget grep sed
Then, as long as whatismyip.com prints out the IP-Address in the HTML page title, you can use this:

Create shell script:
Code:
cd ~
mkdir bin
nano  bin/whatismyip.sh
Insert this into nano (Copy, then paste into nano by pressing Ctrl + Shift + V):
Code:
#!/bin/bash

echo Your external IP Address is:
wget http://Www.whatismyip.com -O - -o /dev/null | grep '<TITLE>' | sed -r 's/<TITLE>WhatIsMyIP\.com \- //g' | sed -r 's/<\/TITLE>//g'

exit 0
(You can also use gedit instead of nano, but I chose to use nano above in case this is done through a remote text-based connection)

Press Ctrl + O, Enter, Ctrl + X, then run:
Code:
chmod u+x bin/whatismyip.sh
Now you can check your external IP Address by running:
Code:
~/bin/whatismyip.sh
...in a terminal.