How to Check MacOS Version (GUI+CLI)

Channel: Linux
Abstract: Use -productName to print the value of the ProductName only sw_vers -productNameUse -productVersion to print the value of ProductVersion. This is the

The macOS 11 is the latest release by the Apple team. Its code name is Big Sur, derived from an unmapped wilderness area that lies along the coast south of Monterey. The is the most advanced desktop operating system with a new level of power and beauty.

This tutorial will describe how to check the macOS version from the desktop and command-line interface.

How to Find MacOS Version (GUI)

Login to your macOS system. Click on the apple icon in the top right corner, then click the 「About This Mac」 menu. This will display the macOS version along with the system configuration details.

The below screenshot shows that we’re using macOS Catalina, which is version 10.15. The macOS version is shown in screenshot 「10.15.7」, which means 「10.15」 is your macOS version 7 is for the security updates of the same.

The output depends on your running macOS version.

How to Find MacOS Version via CLI

Open the terminal application on your macOS and type the following command to check the macOS version.

sw_vers 

Output:

ProductName: 		Mac OS X
ProductVersion:		10.15.7
BuildVersion: 		19H2

You can also fetch the specific values only. Which can be useful for scripting like shell scripts. Use the following command line parameters:

  • Use -productName to print the value of the ProductName only
    sw_vers -productName
    
    Mac OS X
    
  • Use -productVersion to print the value of ProductVersion. This is the version of your macOS, which is generally required with scripting to check macOS version:
    sw_vers -productVersion
    
    10.15.7
    
  • Use -buildVersion to print the value of the BuildVersion property only.
    sw_vers -buildVersion
    
    19H2
    
Conclusion

In this tutorial, you have learned to check the macOS version running on your Apple desktop system. That helps you to find the correct packages for the macOS and make automation scripts.

Ref From: tecadmin
Channels: versionOSXmacOS

Related articles