For what i know, there is no standard way to know for sure…
but each Distro have their own version file you can cat somewhere.
Try these:
- “$cat /etc/redhat-release” will show you information for red hat based distros.
- “$cat /etc/SuSE-release” for SUSE based distros.
- “$cat /etc/mandrake-release” for mandrake distros.
- “$cat /etc/debian_version” for debian based distros.
- “$cat /etc/UnitedLinux-release” might also return some more information.
I also found this useful tip at linuxhelp.net:
You *might* get some clues by running “uname -r” which will show you kernel version - Some ditributors will rename the kernel to make it specific to their distro (eg, RHEL kernels have RHEL in their name)
Note: As pointed out by Ricardo “$cat /etc/debian_version” won’t return the distro itself, but the version of the distro. Sorry :/

June 17th, 2008 at 12:49 pm
The instructions that you gave don’t return the linux distro itself, but the version of the distro.
ie. cat /etc/debian_version -> “lenny,sid,etch,etc..”
:)