To summarize all the responses: There is no easy way to determine the current Linux distribution.
However here are a few thing you could start with.
uname -v
usually gives you a long string with some informations. (E.g.:#66-Ubuntu SMP Thu Apr 25 03:27:11 UTC 2013
)- Debian
/etc/debian_version
, but this is set in Ubuntu, too! - Ubuntu:
/etc/lsb-release
and/etc/os-release
- SuSe:
/etc/SuSE-release
- Many distros also write to
/etc/issue
If you have a list of possible distributions that could happen, you should be able to get that information somehow. If you want a generic approach I'll guess there will be no absolute answer.