OS X Version from Command Line

By | 2011/11/18

There are a few ways to find the OS X version from the command line. I’ll show you how!


$ system_profiler SPSoftwareDataType

Output looks like this:

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: Mac OS X 10.7.2 (11C74)
      Kernel Version: Darwin 11.2.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: mintbookpro
      User Name: Joe Bob (jbob)
      Secure Virtual Memory: Enabled
      64-bit Kernel and Extensions: Yes
      Time since boot: 16:39


$ sw_vers

Output looks like this:

$ sw_vers 
	ProductName:    Mac OS X
	ProductVersion: 10.7.2
	BuildVersion:   11C74


$ defaults read loginwindow SystemVersionStampAsString

Output looks like this:

	
$ defaults read loginwindow SystemVersionStampAsString
	10.7.2

Cool!