How can I find the “friendly name” of the operating system from the shell / Terminal / bash?
Offline Method
This command should find what you're looking for:
awk '/SOFTWARE LICENSE AGREEMENT FOR macOS/' '/System/Library/CoreServices/Setup Assistant.app/Contents/Resources/en.lproj/OSXSoftwareLicense.rtf' | awk -F 'macOS ' '{print $NF}' | awk '{print substr($0, 0, length($0)-1)}'

It's based off the answer found here.  It's tested to work in High Sierra and should work in Mojave.
Online Method
You can also do this online (which is actually what populates &quot;About this Mac&quot; dialog shown in the question):
curl -s https://support-sp.apple.com/sp/product?edid=$( sw_vers -productVersion ) | xmllint --format -xpath &quot;//root/configCode/text()&quot; -

This command will query Apple's server with your poduct version and will extract the OS name from the XML response.  To see the full XML response, simply omit the --xpath &quot;//root/configCode/text()&quot; option:
curl -s https://support-sp.apple.com/sp/product?edid=$( sw_vers -productVersion ) | xmllint --format  -

Response:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;root&gt;
   &lt;name&gt;CPU Name&lt;/name&gt;
   &lt;configCode&gt;macOS High Sierra&lt;/configCode&gt;
   &lt;locale&gt;en_US&lt;/locale&gt;
&lt;/root&gt;