lsb_release -a

Look for the line that starts with Release:. The following number is your version number. As of this writing, mine says Release: 12.04, which means I am running Ubuntu version 12.04.