.Dd October 27, 2022 .Dt SW_VERS 1 .Os .Sh NAME .Nm sw_vers .Nd print macOS system version information .Sh SYNOPSIS .Nm .Nm --productName .Nm --productVersion .Nm --productVersionExtra .Nm --buildVersion .Sh DESCRIPTION .Nm prints macOS version information for the currently running operating system on the local machine. .Pp When executed with no options .Nm prints a short list of version properties: .Pp .Bd -literal % sw_vers ProductName: macOS ProductVersion: 13.0 ProductVersionExtra: (a) BuildVersion: 22A100 .Ed .Pp The .Ar ProductName property provides the name of the operating system release (typically "macOS"). The .Ar ProductVersion property defines the version of the operating system release (for example, "11.3" or "12.0"). The .Ar ProductVersionExtra property defines the Rapid Security Response version, if one is installed on the operating system (for example, "(a)" or "(b)"). The .Ar BuildVersion property provides the specific revision of the operating system as generated by the macOS build system. .Sh OPTIONS The output of .Nm can be refined by the following options. These long-form options can also be passed in lowercase for convenience. .Bl -tag -width "--productVersionExtra" .It Fl Fl productName Print only the value of the ProductName property. .It Fl Fl productVersion Print only the value of the ProductVersion property. .It Fl Fl productVersionExtra Print only the value of the ProductVersionExtra property. .It Fl Fl buildVersion Print only the value of the BuildVersion property. .El .Pp .Sh EXAMPLES .Pp .Bd -literal % sw_vers --productName macOS .Ed .Pp .Bd -literal % sw_vers --productVersion 13.0 .Ed .Pp .Bd -literal % sw_vers --productVersionExtra (a) .Ed .Pp .Bd -literal % sw_vers --buildVersion 22A100 .Ed .Pp .\" .Sh ENVIRONMENT \" May not be needed .\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 .\" .It Ev ENV_VAR_1 .\" Description of ENV_VAR_1 .\" .It Ev ENV_VAR_2 .\" Description of ENV_VAR_2 .\" .El .Sh COMPATIBILITY .Pp Previous versions of .Nm respected the .Ar SYSTEM_VERSION_COMPAT environment variable to provide compatibility fallback versions for scripts which did not support the macOS 11.0+ version transition. This is no longer supported, versions returned by .Nm will always reflect the real system version. .Pp .Nm is backwards compatible with previous versions which expect options passed with a single dash, as in: .Bl -tag .It Fl productName .El .Pp .Sh FILES .Bl -tag -width "/System/Library/CoreServices/SystemVersion.plist" -compact .It Pa /System/Library/CoreServices/SystemVersion.plist .El