sw_vers
Print macOS operating system version information. tldr-pages
On macOS 1 Sigma rule name it
macOS
Print all available information (OS name, version number, and build)
sw_versIdentifyPrint only the version number of the operating system
sw_vers -productVersionIdentifyTrips 1 Sigma rule: mediumSystem Information Discovery Using sw_vers by Joseliyo Sanchez, @Joseliyo_Jstnk
Print only the build identifier
sw_vers -buildVersionIdentifyTrips 1 Sigma rule: mediumSystem Information Discovery Using sw_vers by Joseliyo Sanchez, @Joseliyo_Jstnk