If you have a dynamic IP address (one that changes every time you connect to the net), there are a number of GUI tools that will display it for you. However, if you want to be able to get your IP number from a terminal session, the following appears to be the easiest way. The command uses 'wget' to read the contents of a web page that returns your IP address as seen by the external web server, and then processes the web page to extract the IP. The command to type is:
wget -q -O /dev/stdout http://tools.lyceum.net/network/showmyip |[space]
grep '<H1>' | sed 's|</*H1>||g'
NOTE: Shown on two lines for a narrower window; enter on one line and replace [space] with an actual "space" character.
You'll get a single line containing your external IP address. Note that this will only continue to work as long as tools.lyceum.net doesn't change the format of their web page! Thanks to everyone (see the comments) who contributed to the development of this tip.
Read the rest of this article for an explanation of how it works, and a way to make an easy to use "alias" that will make it as simple as typing "showmyip" or whatever you'd like to call it.
So what does that complicated line of text do? In a nutshell, it goes out to a website which reads your IP number. Using wget in quiet mode (-q) and with output directed to standard output (-O /dev/stdout), the web page (http:////tools.lyceum.net/network/showmyip) is grabbed, and then the resulting HTML is sent (|) through the UNIX search command (grep). grep is looking for a particular HTML tag (H1) which denotes the start of the line that contains the actual IP address.
SIDEBAR COMMENT: This command will break badly if lyceum.net ever changes the formatting of the output page -- so if it starts misbehaving, that's probably what happened! To fix it, you'd need to view the raw HTML on the page and see if there's a way to identify where the IP number starts, and then adjust the 'grep' and 'sed' portions of the command.
The 'grep' command returns a line which looks like <H1>12.34.56.78</H1>, where 12.34.56.78 is your actual IP number. This is then passed (again, via the |) to 'sed', which will edit the stream of data it just received. 'sed' runs a search and replace (near as I can tell; it's beyond my skills at present!) which takes the H1 start and end tags out, leaving just the IP number. Pretty slick.
Now, to make this easily useful, just embed it in an alias:
alias myextip 'wget -q -O /dev/stdout http://tools.lyceum.net/network/showmyip[space]
| grep H1 | sed "s|</*H1>||g" '
NOTE: Shown on two lines for a narrower window; enter on one line and replace [space] with an actual "space" character.
See Bart's comments for information on how to make the alias permanent.

