Sysadmin's Shouts!

a blog for sysadmin's rants and raves…


Leave a comment

What OS is this??? – Gathering basic system info – Part 2

Hi,

we’re back on the second series of trying to find some more information about the machine were we have just logged in…

Another 2 commands we can execute to try and find more info about the box, in this case regarding the OS version, is displaying this files:

	/etc/issue

And in some others

	/etc/release

They may exist both, one, or none, depending in the OS, but in general we will just try /etc/release.
To show this files, we can use one of this commands:

	cat
	type
	more
	less
	grep

We’ll try with a few Linux Flavours,

A Linux Server with Ubuntu 12.04 LTS (Intel CPU, 64 bit):

root@serverubuntu:/# uname -a
Linux serverubuntu 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:13:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/issue
Ubuntu 12.04.02 LTS \n \l

A Linux Server with CentOS 6.4 Final (Intel CPU, 64 bit):

root@srvcentos:/# uname -a
Linux srvcentos 2.6.32-358.el6.x86_54 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m

A Linux Server with Oracle Linux (OL) 6.4 (Intel CPU, 64 bit):

[root@Ora11g01 ~]# uname -a
Linux Ora11g01.local 2.6.39-400.17.1.el6uek.x86_64 #1 SMP Fri Feb 22 18:16:18 PST 2013 x86_64 x86_64 x86_64 GNU/Linux

[root@Ora11g01 ~]# cat /etc/issue
Oracle Linux Server release 6.4
Kernel \r on an \m

Now we’ll move over to another OS, in this case “Neo” from a Storage Cabinet, and EMC VNXe 3100:

service@(none) spb:~> uname -a
Linux spb 2.6.32.59-0.7.1.00.036.NeoMain.SLES11SP1.NEO #1 SMP Wed Aug 28 10:20:58 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux

Now a Brocade SAN FC Switch with “FabOS”:

switch_01:root> uname -a
Linux switch_01 2.4.19 -n #1 Tue Oct 3 21:06:25 PDT 2006 ppc unknown

switch_01:root> uname -v
-n #1 Tue Oct 3 21:06:25 PDT 2006

switch_01:root> uname -r
2.4.19

switch_01:root> cat /etc/issue

Fabric OS (@S)

A vSphere ESXi v5.1:

~ # uname -a
VMkernel srvesx01.local 5.1.0 #1 SMP Release build-1612806 Feb 17 2014 03:05:46 x86_64 GNU/Linux

~ # uname -v
#1 SMP Release build-1612806 Feb 17 2014 03:05:46

~ # uname -r
5.1.0

~ # uname -m
x86_64

An lastly, and old UNIX flavour: SCO (Santa Cruz Operation) OpenServer:

# uname -a
SCO_SV serversco 3.2 5.0.6 i386

Well, so there we have, a few examples of the output we can get from uname, cat /etc/release & cat/etc/issue, and that we can use to check the OS type, version, etc, and use in our scripts to make them multiOS (which is always appreciated in heterogeneous environments).

In the third and last series, I will post some examples of uname under

  • HP-UX,
  • Solaris,
  • RHLE,
  • NonStop and
  • AIX.

Until then!