I know that I can use
sw_ver to find this information:
ProductName: Mac OS X ProductVersion: 10.14 BuildVersion: 18A353d
…and I know I can find other things like
uname can give me some types of information about the OS, and
system_profiler SPSoftwareDataType can give me additional information, but I want to find the “friendly” name, such as “Mojave” in the image shown above.
How can I find the “friendly” name, using the shell / Terminal / bash / etc ?
So far my Google fu has failed to turn up any solutions. All the results seem to come back to those commands I mentioned above, but none of those give me the right information.
It has to be in there somewhere… how can I find it?