sw_vers

Print Mac OS X operating system version.

Syntax
      sw_vers
sw_vers -productName
sw_vers -productVersion
sw_vers -buildVersion Key -productName Print just the value of the ProductName property. -productVersion Print just the value of the ProductVersion property. -buildVersion Print just the value of the BuildVersion property.

When executed with no options sw_vers prints a short list of version properties:

% sw_vers
ProductName: Mac OS X
ProductVersion: 10.3
BuildVersion: 7A100

The ProductName property provides the name of the operating system release (typically either "Mac OS X" or "Mac OS X Server"). The ProductVersion property defines the version of the operating system release (for example, "10.2.4" or "10.3"). The BuildVersion property provides the specific revision of the operating system as generated by the Mac OS X build system.

Example

$ sw_vers -productName

"Have no friends not equal to yourself" ~ Confucious (Analects)

Related:

set - Set a shell variable = value
unset - Remove variable or function names


© Copyright SS64.com 1999-2013
Some rights reserved