Wednesday, June 27, 2007

how to get operating system version in Linux/Solaris

A quicky because my brain wasn't working well yesterday. Here are two quick ways to get the operating system version on a Linux box or a Solaris box:

1) sar
Take the top of the output using "sar ¦ head". The output looks like this:
cricketbox cricket >sar ¦ head

SunOS njunpcrkt00 5.8 Generic_108528-29 sun4u 06/27/07

00:01:00 %usr %sys %wio %idle
00:06:00 0 1 1 98
00:11:00 1 2 2 95
00:16:00 1 2 7 90

2) uname -a
cricketbox cricket >uname -a
SunOS njunpcrkt00 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Fire-280R

On a Linux box like the Fedora Core 6 box below, uname may only print the kernel version:
[user@computer ~]# uname -a
Linux 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:37:32 EDT 2006 i686 i686 i386 GNU/Linux

Here's a related article on how to find the BIOS version of your hardware:

Have a good day.

No comments:

Feel free to drop me a line or ask me a question.