0

I normally use uname to determine which OS is running, but I have accounts on several machines where I don't know the particular distribution that is running.

When uname returns Linux, I tried uname -a and I see only the following:

 Linux host123 3.0.58-0.6.6-pae blah blah blah i686 i686 i386 GNU/Linux

My guess is this is a SUSE distribution, but is there a better way to know which distribution is installed similar to how uname normally shows AIX, Darwin, etc...?

bmike
  • 302
  • @manatwork Once I asked this, I did find the linked question, but I really don't care about the version number details and wanted a simple, clear next step tool to break down what Linux means when uname reports it. The other long scripting questions didn't hit any of my search terms so I figured I'd document what I found for others to find. – bmike Jun 28 '13 at 16:27

1 Answers1

5

Once you get Linux from uname you can run (or check for the existence of) lsb_release and run it with the -si switch if you just want the Distributor ID:

 user@host123:~> lsb_release -si
 SUSE LINUX

Similarly, both uname -a and lsb_release -a give more detailed build information. Alternatively, cat /etc/issue gives fairly reliable information on the distribution of Linux.

bmike
  • 302
  • Thanks for posting your answer, however, this is the same answer as given in the accepted one of the duplicate question, which is why your question was closed. – terdon Jun 28 '13 at 20:07
  • No worries - I'm quite familiar with moderation on the SE network even if I don't come by this section of it often. Thanks for making sure I knew what was up :-) – bmike Jun 28 '13 at 20:51
  • Ah, yes, just checked your profile :). – terdon Jun 28 '13 at 20:54
  • Also, once I finally found out about lsb_release, I figured you'd all dupe this with http://unix.stackexchange.com/questions/31170/why-doesnt-uname-a-return-a-useful-identifier or http://unix.stackexchange.com/questions/35183/how-do-i-identify-which-linux-distro-is-running but in the end - it's all good since the index is so great at searching closed questions. – bmike Jun 28 '13 at 20:55