First option,
cat the /etc/issue file.
danny@family-desktop:/etc$ cat /etc/issue
Ubuntu 8.04.1 n l
Second option
cat the /etc/lsb-release file.
danny@family-desktop:/etc$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu 8.04.1"
or
run the lsb_release command with the “-a” switch.
danny@family-desktop:/etc$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:   Ubuntu 8.04.1
Release:       8.04
Codename:      hardy