Determine OS version from Command line in MacOS

Sometimes we would like to know about the installed MacOS from Terminal. Or say we are writing scripts to extract the OS related information like it's version and release name etc.

For Mac we have couple of options

System Profiler

Execute the following command from Terminal

system_profiler


As you can see from the screenshot system_profiler will print a lot of information about the Software and Hardware of the Mac.

This is it.....




sw_vers

Execute the following command from Terminal

sw_vers

As you can see from the screenshot sw_vers will print information about the current installed OS Name and Version.

Comments

Popular posts from this blog

Difference between volatile and synchronized

Converting Java Map to String

Masking Credit Card number in Java