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.
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.
on slackware "cat /etc/slackware-version" returns "Slackware 13.1.0"
you may or may not have such a file in your /etc directory
ie /etc/<DistroName>-version
There is also some code here which uses the contents of /etc/lsb-release. I would change the elifs to a case statement -- cleaner code.
As for making a HowTo, this is as good a place as any to shape it; & when it looks good, put it in the LQ Linux Tutorials. If shaping it here is too cumbersome for group editing, then maybe the LQ Wiki is a good place.
A search of each might be in order before we start. We don't want to duplicate effort.
Just throwing that out there and the guy that gave the cmd
cat /etc/*release <- SUPER WIN!! TY! The other cmd cat /etc/*version showed my asterisk pbx version instead of the OS on Centos 5.6
I know this is an old thread but VERY IMPORTANT TO ME!!!!!! I have been on the jump for this, it's already hitting the printer AS WE SPEAK!! Vital news...I got Centos stickers to label a network here and have to SSH threw a mess of machines. Thanks again!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.