How to find out what Linux Distribution/OS you’re running
Sometimes it’s a pain in the ass to install software on unix based systems without having prior knowledge to the OS/kernel versions.
You’d do something on debian that doesn’t work on CentOS, Fedora has yum pre-installed where as RHEL4 comes with up2date but you have to have a key, then there’s always RPM’s but who really wants to use RPM’s? You might as well just compile it yourself from source.
Here is a few commands that (should) return exactly what kind of linux operating system you are running.
[bryan@crainbandy ~] dmesg | head -1 [bryan@crainbandy ~] cat /proc/version [bryan@crainbandy ~] cat /etc/issue [bryan@crainbandy ~] uname -a
I hope that helps. If you can’t figure it out with one of the commands above then I guess you’re S.O.L.
Geaux team.
Bryan
Related reading
4 Responses to “How to find out what Linux Distribution/OS you’re running”
Leave a Reply

Kalpesh Sutaria on May 20th, 2009
Isn’t it about time that all Linux distributions follow a standard? In the case where I need to identify the distribution using an automated script, it would be an absolute pain to miss one of the scenarios.
bryan on May 21st, 2009
Trust me I feel your pain. That’s why I wrote this post not only as a personal note but for other people going through the same frustrations I was trying to figure out what exact distribution/linux version was running.
brandon on January 9th, 2010
Every Linux distro I have used Identifies itsself during boot on the splash screen. Most gui front ends also have in one of the menus “about this computer” which tells you what you are running.
Shadus on January 21st, 2010
Often times you can check /etc/debian_version or /etc/redhat-release for derivatives of those systems. dmesg | head -10 often catches things too.
cat /etc/*{version,release} will catch it 9/10 times.