Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks , but there is no option on uname which can correctly show OS .
For example on a server with centos 4 , is simply shows "GNU/Linux"
I don't think there's a command that can identify distros. There has to be something unique to a distro for something to identify the distro, and as all distros use mostly the same code/programs there's nothing unique to be identified.
Most versions of Linux put a version file in the /etc directory with the version number of the distro..
the downside is they don't all give the file the same name to make it easy..
Granted we know that you probably mean "any *nix",
but it would be nice to be sure.
I don't think it's easily done -- even the /etc/debian-version
on my SimplyMEPIS boxen (3.3.2 & 6.0) say nothing about MEPIS,
just "testing/unstable" & "testing".
Several distros maintain a text file containing the info. I asked a question on here a while ago to try and gather a list, you could search for it, contained information on distro information paths.
For example arch has /etc/arch-release however as of the latest release, it doesn't contain anything.
Which is a pig since i had a system information script that would poll various files to state the distro
Several distros maintain a text file containing the info. <snip>
For example arch has /etc/arch-release however as of the latest release, it doesn't contain anything.
<snip>
I found that on Ubuntu I have two similar files:
Quote:
/etc/debian_version
/etc/lsb-release
The former one contains only number 4, which probably means on which version of Debian was current Ubuntu based on. The lsb-release file contains all the information needed.
Similarly, on CentOS I found file /etc/redhat-release.
It seems that
Quote:
cat /etc/*release
or
Quote:
cat /etc/*version
should do on many Linux systems (but of course not on any).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.