OS X Command To Tell Version of OS X I’m On From the Bash Command Line

Fig.02: Tell what version of OS X you are using on from the command line

Fig.02: Tell what version of OS X you are using on from the command line

So you want to find out what version of OS X your are using on from the command line? Try the following command:
$ sw_vers
$ system_profiler SPSoftwareDataType

Sample outputs:

Software:
 
    System Software Overview:
 
      System Version: OS X 10.11.1 (15B42)
      Kernel Version: Darwin 15.0.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Vivek’s MacBook Pro
      User Name: Vivek Gite (veryv)
      Secure Virtual Memory: Enabled
      Time since boot: 20 days 20:34

Examples and usage: How to find out Mac OS X operating system version information from Terminal command prompt