How can I get my Mac OS X version from the command line?

Under almost all circumstances, you can just go to “About this Mac” or use the system profiler. However, very rarely I am accessing a machine remotely using SSH where I don’t also have the ability to Remote Desktop or VNC to the machine. In these cases, you can get the exact version number of Mac OS X like this:

system_profiler SPSoftwareDataType

On my mac, it returns:

System Software Overview:
System Version: Mac OS X 10.5.7 (9J61)
Kernel Version: Darwin 9.7.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: Fleetwood’s Mac
User Name: jason (jason)
Time since boot: 2 days 23:57

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous post Installing Rails & MySQL On Mac OS X
Next post Rails error: undefined method `use_transactional_fixtures=`