Name

sw_vers — stdin  stdout  - file  -- opt  --help  --version

Synopsis

sw_vers [options]

The sw_vers command displays the OS X software version on your Macintosh:

sw_vers
ProductName:    Mac OS X
ProductVersion: 10.7.3
BuildVersion:   11D50

Useful options

-productName

Print only the product name.

-productVersion

Print only the product version.

-buildVersion

Print only the build version.

Get Macintosh Terminal Pocket Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.