sw_vers – print macOS version information

NAME
sw_vers – print macOS version information

SYNOPSIS
sw_vers
sw_vers -productName
sw_vers -productVersion
sw_vers -buildVersion

DESCRIPTION
sw_vers prints macOS version information for the currently running operating system on the local machine.

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

% sw_vers
ProductName: macOS
ProductVersion: 12.0
BuildVersion: 21A100

The ProductName property provides the name of the operating system release (typically “macOS”). The ProductVersion property defines the version of the
operating system release (for example, “11.3” or “12.0”). The BuildVersion property provides the specific revision of the operating system as generated by
the macOS build system.

OPTIONS
The output of sw_vers can be refined by the following options. These long-form options are case-insensitive.

-productName Print only the value of the ProductName property.

-productVersion Print only the value of the ProductVersion property.

-buildVersion Print only the value of the BuildVersion property.

EXAMPLES
% sw_vers -productName
macOS

% sw_vers -productVersion
12.0

% sw_vers -buildVersion
21A100

FILES
/System/Library/CoreServices/SystemVersion.plist

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *