Which version of SunOS

Solution 1:

Use following command uname -r in terminal

Solution 2:

To clear things up for everyone:

  • uname -r will show the major version number prefixed by 5. (e.g., Solaris 9 will be 5.9, 10 will be 5.10 and 11 will be 5.11)
  • uname -v will be the kernel patch number or nevada build number. Prior to OpenSolaris this will be meaningless to you as patches can be installed independent of update releases. On Solaris 10 & earlier it's a patch number (on S10 x86 it's "Generic_142910-17", or thereabouts). Any Nevada build (OpenSolaris, Solaris 11 and IllumOS based releases) will be the build number. On Solaris 11 Express it's "snv_151a"
  • The contents of /etc/release will be have the actual product version. E.g., Solaris 10 update 9 will show "Solaris 10 9/10 s10x_u9". Again, Nevada builds will have the snv build number.

In any case the best way to get the correct meaningful version number is the contents of /etc/release. Specifically, the second to the last field of the first line.

Or most simply:

$ head -1 /etc/release | awk ' { print $(NF-1) }'
s10x_u9wos_14a

Edit:

A note about major/minor version confusion on Solaris.

Solaris started life as SunOS, which was based on BSD, which ended with the kernel at version 4 (same as the BSD 4.x line). Time passes and it's re-based on System V. The product is renamed Solaris, and branded as Solaris 2. The kernel version is set to 5.0. Solaris 2 through 2.6 are released, corresponding with kernel versions 5.0-5.6. With the next release the "major" numbers are completely removed from marketing and branding and it's simply called as Solaris 7. This tradition continues to today. So Solaris 10 is actually Solaris 2.10, kernel version 5.10. Solaris 11 is likewise 2.11 and 5.11.

But for all intents and purposes the traditional "minor" number is now the "major" number. There will never be SunOS 6.0, nor Solaris "3", which is why I refer to it as the major number.