You are correct in the fact that oslevel will give you the current installed version, but that is not always enough information particularily if you are asked the question by support personnel.
# oslevel <--- this will only give you the Base Level
To be more precise you should use the following command which will give you additional Technology Level, Maintenance Level and Service Pack level information.
# oslevel -s
5300-09-02-0849
This will give you
"5300" - Base Level
"09" - Technology Level
"02" - Maintenance Level
"0849" - Service Pack
On some older versions of AIX the -s option is not available in whichh cas you should use the -r option which will report as far as the Technology level
nb: This function is compatible with both KSH and BASH, so you can put in ~/.bashrc instead if you are a BASH fan.
nb2: The last 4 digits from oslevel are the year and week the SP was released. I don't particularly care to see that, so I left it out. I was happy enough with Version/TL/SP.
EDIT 2018-02-22: I just came up with an equivalent but shorter implementation, and no longer depends on bc and uses awk instead of cut & bc.
You are correct in the fact that oslevel will give you the current installed version, but that is not always enough information particularily if you are asked the question by support personnel.
# oslevel <--- this will only give you the Base Level
To be more precise you should use the following command which will give you additional Technology Level, Maintenance Level and Service Pack level information.
This will give you
On some older versions of AIX the -s option is not available in whichh cas you should use the -r option which will report as far as the Technology level
I hope this helps
Mike Scheerer
I just added this to my ~/.profile, so I immediately see the AIX version on login:
Example output:
nb: This function is compatible with both KSH and BASH, so you can put in ~/.bashrc instead if you are a BASH fan.
nb2: The last 4 digits from oslevel are the year and week the SP was released. I don't particularly care to see that, so I left it out. I was happy enough with Version/TL/SP.
EDIT 2018-02-22: I just came up with an equivalent but shorter implementation, and no longer depends on
bc
and usesawk
instead ofcut
&bc
.As a one-liner:
Output:
As a shell function:
Output:
You can use "uname" with various options:
You can use the following command:
It will show result like below.
Which translates to: