system_profiler SPApplicationsDataType >> ~/Desktop/SomeFilename.txt
system_profiler SPInstallHistoryDataType -json | awk -F'"' '/_name|install_version|install_date/{print $2,$4}' | grep -A3 "macOS" | sed -e 's/_name /Name: /g;s/install_version /Version: /g;s/install_date /Date: /g'
JSON format
system_profiler SPApplicationsDataType -json
grep mac,stable, | cut -b ’12-24′
system_profiler SPApplicationsDataType -json | grep mac,stable, | cut -b ’12-24′