I have been known to occasionally ask what build number of Mac OS X that someone is using. The sw_vers command can be used to obtain this. Simply run:
sw_vers
And the BuildVersion will be listed. Or just to get the BuildVersion:
sw_vers | grep BuildVersion
Or to just get the number (useful in scripts that catalog such a thing:
sw_vers | grep BuildVersion | cut -c 15-21
As one comment just indicated, you could also just use `sw_vers -buildVersion`. I guess I should review these commands every operating system or 4… Thanks Allen.