Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Finding out OS X version from the terminal

Finding out OS X version from the terminal
Thread Tools
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
Dec 5, 2003, 02:57 AM
 
How can I find out the OS X version, including possibly the build number from the terminal? I know in 10.3, system_profiler can be used, but I don't think this existed in 10.0-10.2.

Thanks
<This space under renovation>
     
JLL
Professional Poster
Join Date: Apr 1999
Location: Copenhagen, Denmark
Status: Offline
Reply With Quote
Dec 5, 2003, 03:07 AM
 
more /System/Library/CoreServices/SystemVersion.plist
JLL

- My opinions may have changed, but not the fact that I am right.
     
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Dec 5, 2003, 05:17 PM
 
defaults read loginwindow SystemVersionStampAsString
defaults read loginwindow BuildVersionStampAsString

or you can just

defaults read loginwindow

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
K++
Senior User
Join Date: Jan 2002
Location: NYC
Status: Offline
Reply With Quote
Dec 5, 2003, 11:49 PM
 
Or good old hostinfo.
     
Drakino  (op)
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
Dec 6, 2003, 02:00 PM
 
Originally posted by K++:
Or good old hostinfo.
Hostinfo only shows the Darwin version, not the overall OS X version.
<This space under renovation>
     
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Dec 6, 2003, 10:21 PM
 
Originally posted by Drakino:
Hostinfo only shows the Darwin version, not the overall OS X version.
You can, however, get a pretty good idea of what version of OS X is running based on that Darwin version. Subtract four from the first number and you have it!

Darwin 6.8 would be [10.]2.8
Darwin 7.0 would be [10.]3.0
Darwin 6.3 would be [10.]2.3
Darwin 5.5 would be [10.]1.5

The reason it isn't perfect is because the kernel isn't always updated. It wasn't updated with 10.3.1, so it still says Darwin 7.0.0.

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Dec 7, 2003, 02:31 AM
 
w00t:
Code:
[aorth@Alan-Orths-Computer: ~]$ sw_vers ProductName: Mac OS X ProductVersion: 10.3.1 BuildVersion: 7C107
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status: Offline
Reply With Quote
Dec 8, 2003, 09:59 PM
 
Originally posted by [APi]TheMan:
w00t:
Code:
[aorth@Alan-Orths-Computer: ~]$ sw_vers ProductName: Mac OS X ProductVersion: 10.3.1 BuildVersion: 7C107
Just goes to show: there's always another way to do it in Unix.

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
     
Drakino  (op)
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
Dec 9, 2003, 12:49 AM
 
Originally posted by Detrius:
You can, however, get a pretty good idea of what version of OS X is running based on that Darwin version. Subtract four from the first number and you have it!
Reason I want to avoid trying to translate Darwin numbers is two fold:

1. The script would have to be updated if a new version came out.

2. It might not be OS X, since Darwin is a standalone OS, even for x86.

I'm tweaking an existing XChat sysinfo script to work better with OS X. I have it pulling laptop battery info already, and some other changes.
<This space under renovation>
     
Junior Member
Join Date: Nov 2003
Status: Offline
Reply With Quote
Dec 10, 2003, 03:10 PM
 
Originally posted by Detrius:
defaults read loginwindow SystemVersionStampAsString
defaults read loginwindow BuildVersionStampAsString
we have a winner
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:56 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2