The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   System (http://hintsforums.macworld.com/forumdisplay.php?f=4)
-   -   How to tell OS X version from CLI? (http://hintsforums.macworld.com/showthread.php?t=18697)

jmu200 12-18-2003 09:12 AM

How to tell OS X version from CLI?
 
Hi, Does anyone know how to tell the version of OS X via the command line? Is it possible to cat a file and the contents will tell you the version? (i.e. 10.1, 10.2, 10.3)

Thanks,

jules

Cap'n Hector 12-18-2003 10:34 AM

Well, I don't have 10.0, 10.1, 10.2, or 10.3 handy here to check but there are some possibilities:

/System/Library/CoreServices/SystemVersion.plist

sw_vers has some good reporting, but I _think_ it was added with Panther.

robJ 12-18-2003 10:47 AM

Quote:

Originally posted by Cap'n Hector sw_vers has some good reporting, but I _think_ it was added with Panther.
It's available in 10.2.8 (maybe earlier).

-- Rob

mervTormel 12-18-2003 11:05 AM

Code:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.3.1
BuildVersion:  7C107


Cap'n Hector 12-18-2003 12:30 PM

Well, I checked some systems:

10.2.0 has sw_vers.

10.1.0 has sw_vers.

10.0 has sw_vers.

The result of the command looks the same on 10.1, 10.2 and 10.3 so it can be parsed or passed command-line options for getting the version of the OS.


All times are GMT -5. The time now is 05:34 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.