#!/usr/bin/env sh
#/usr/local/bin/version echo `head -n 1 /etc/apt/sources.list | cut -d' ' -f 3` `cat /etc/issue | cut -d' ' -f 1-2`
Go ahead and put that in /usr/local/bin/version to call at your goodwill and pleasure.
By Name: head -n 1 /etc/apt/sources.list | cut -d' ' -f 3
By Number: cat /etc/issue
By Kernel: uname -r
Other methods:
lsb_release -a
cat /etc/lsb-release
Appendix A:
http://ubuntu-tutorials.com/2007/01/27/how-to-find-your-ubuntu-or-kernel-version/