Debian /etc/debian_release, /etc/debian_version,
Fedora /etc/fedora-release
Gentoo /etc/gentoo-release
Mandrake /etc/mandrake-release
Novell SUSE /etc/SUSE-release
Red Hat /etc/redhat-release, /etc/redhat_version
Slackware /etc/slackware-release, /etc/slackware-version
Solaris/Sparc /etc/release
Sun JDS /etc/sun-release
Ubuntu /etc/lsb-release
UnitedLinux /etc/UnitedLinux-release
Yellow dog /etc/yellowdog-release
You can find more information on this problem as well as a shell script to assist with OS detection here. An even larger master list can be found here.
5 comments:
You may already know this, but the non-portability of version information is one of the problems that the Linux Standard Base is trying to solve. Hence the 'lsb-release' file in one of your listed distributions.
what about `cat /etc/issue`? I've only tested CentOS, REHL and Ubuntu. Does anybody else know if its supported by the other major distros?
lsb-release is around for maybe ages, yet only a few distributions contain this file. So, relying on lsb-relase is itsef non-portable :)
Usually I watch /et/issue
/etc/issue is used for sshd's banner, so a lot of systems will alter it. `cat /etc/*release' is fairly reliable in my experience.
Post a Comment