Just how can I inform what version of OS X I'm on from the command line?
I regularly locate myself SSHing right into numerous OS X equipments, and also it would certainly serve if I can inform what version of OS X I got on when I'm doing that.
uname -a does not fairly function, given that Darwin bit versions do not constantly transform with the remainder of the system.
My pointer is to make use of
sw_vers. Instance result since 10.6.4 :
> sw_vers ProductName: Mac OS X ProductVersion: 10.6.4 BuildVersion: 10F569
The solution that recommended
system_profiler | grep 'System Version' is what I have actually attempted to make use of in the past, yet it has 2 troubles.
- It is slow-moving given that it creates a complete system_profiler dump of the equipment, collecting all software and hardware supply details.
- The result of system_profiler has actually transformed with time. as an example result of
grepfor 'Serial Number' on 10.6.4 is "Serial Number (system) : ZNNNNNZNZZZ", whereas on 10.4.11 it was "Serial Number : ZNNNNZNZZZZ" - relevance being the parse - capacity of the result and also the add" (system)" item can be bothersome unless you are anticipating the adjustment.
The most convenient means is :
$ sw_vers -productVersion 10.6.4
$ sw_vers ProductName: Mac OS X ProductVersion: 10.6.4 BuildVersion: 10F569 $ sw_vers -productVersion 10.6.4
Specifically convenient when resetting a password in solitary customer setting, given that the method differs based upon which version of OS X is running.