macOS is the latest operating system that is developed and marketed by Applen Inc. Previously known as Mac OS X and later OS X, this operating system is Unix-based. It is designed to run on Apple's Macintosh computers or Macs and comes pre-installed in all Mac since 2002. It is the second most widely used desktop operating system after Microsoft Windows.
There are two ways you can check the version of you Mac. See below.
system_profiler SPSoftwareDataType and hit enter.