How can I identify the macOS version from the command line?
I don't know if all of this is imposed by Darwin, the manual page seems like it maybe is a Mac OS X (sic in my manual page as of Sep 2019) thing, but there is the awesome sw_vers:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.6
BuildVersion:   yadda yadda yadda
$ _