You will see a display similar to the following one:
If you wish to determine the version number of an app from the command line,
if the application supports command line options, you may be able to use
one such as -v
or -version
to determine the version.
Or you can use the system_profiler SPApplicationsDataType
command to obtain a similar comprehensive list.
E.g., here are a few commands to determine the operating system version and the version of a few common applications under OS X from a command prompt, which can be obtained using the Terminal application.
Determine the OS version with sw_vers
.
$ sw_vers ProductName: Mac OS X ProductVersion: 10.8.5 BuildVersion: 12F45
The Wikipedia OS X article provides the names given by Apple to each version. E.g., OS X 10.8.5 is called "Mountain Lion".
Determine the version of Java with java -version
$ java -version java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
Determine the version of Firefox with
/Applications/Firefox.app/Contents/MacOS/firefox -v
or
-version
.
$ /Applications/Firefox.app/Contents/MacOS/firefox -v Mozilla Firefox 31.5.0 $ /Applications/Firefox.app/Contents/MacOS/firefox -version Mozilla Firefox 31.5.0
Determine the version of
GNU Image Manipulation Program
(GIMP) with
/Applications/Gimp.app/Contents/MacOS/gimp --version
or
/Applications/Gimp.app/Contents/MacOS/gimp -v
with the
-v
option providing more details.
$ /Applications/Gimp.app/Contents/MacOS/gimp --version Setting up environment... Enabling internal python... Locale black magic... Launching GIMP... GNU Image Manipulation Program version 2.8.10 $ /Applications/Gimp.app/Contents/MacOS/gimp -v Setting up environment... Enabling internal python... Locale black magic... Launching GIMP... GNU Image Manipulation Program version 2.8.10 git-describe: GIMP_2_8_8-55-g9bb7eb0 using GEGL version 0.2.1 (compiled against version 0.2.1) using GLib version 2.38.2 (compiled against version 2.38.2) using GdkPixbuf version 2.30.1 (compiled against version 2.30.1) using GTK+ version 2.24.22 (compiled against version 2.24.22) using Pango version 1.36.0 (compiled against version 1.36.0) using Fontconfig version 2.11.0 (compiled against version 2.11.0) using Cairo version 1.12.16 (compiled against version 1.12.16)
If you would like to see all of the available command line options for
GIMP, you can use /Applications/Gimp.app/Contents/MacOS/gimp -?
,
or -h
, or --help
, instead of the -?
.
You can get the version for many applications at once using the command
system_profiler SPApplicationsDataType
. E.g., below is a
partial list of software found on a MacBook Pro; I snipped the rest of
the output which was quite lengthy.
$ system_profiler SPApplicationsDataType Applications: Firefox: Version: 31.5.0 Last Modified: 5/16/14 9:39 AM Kind: Intel 64-Bit (Intel): Yes App Store: No Get Info String: Firefox 31.5.0 Location: /Applications/Firefox.app Adobe Flash Player Install Manager: Version: 17.0.0.134 Last Modified: 4/6/15 2:20 PM Kind: Intel 64-Bit (Intel): No App Store: No Location: /Applications/Utilities/Adobe Flash Player Install Manager.app ScanEventHandler: Version: 1.2.0 Last Modified: 4/6/15 2:07 PM Kind: Intel 64-Bit (Intel): Yes App Store: No Get Info String: Copyright (c) 2013-2014 Hewlett-Packard Development Company, L.P. Location: /Library/Printers/hp/Utilities/Handlers/ScanEventHandler.app HP Scanner 3: Version: 4.8.1 Last Modified: 4/6/15 2:07 PM Kind: Intel 64-Bit (Intel): Yes App Store: No Get Info String: Copyright © 2011-2014, Hewlett-Packard Development Company, L.P. Location: /Library/Image Capture/Devices/HP Scanner 3.app hpdot4d: Version: 4.10.3 Last Modified: 4/6/15 2:07 PM Kind: Intel 64-Bit (Intel): Yes App Store: No Get Info String: hpdot4d 4.10.3, Copyright (c) 2005-2014 Hewlett-Packard Development Company, L.P. Location: /Library/Printers/hp/Frameworks/HPDeviceModel.framework/Versions/4.0/Runtime/hpdot4d.app HP Utility: Version: 5.23.4 Last Modified: 4/6/15 2:07 PM Kind: Intel 64-Bit (Intel): Yes App Store: No Get Info String: HP Utility 5.23.4, Copyright (c) 2005-2014 Hewlett-Packard Development Company, L.P. Location: /Library/Printers/hp/Utilities/HP Utility.app Safari: Version: 6.2.3 Last Modified: 4/6/15 2:00 PM Kind: Intel 64-Bit (Intel): Yes App Store: No Get Info String: 6.2.3, Copyright © 2003-2014 Apple Inc. Location: /Applications/Safari.app ...
You can use the command with grep
to obtain the version of
a particular program by piping the output of the command to grep
then displaying the next 2 lines after the match on the name followed by a
colon, e.g. grep "Safari:" -A 2
would match the start of the
Safari section of the output and display the version which will be on the
second line after the application name. E.g.:
$ system_profiler SPApplicationsDataType | grep "Safari:" -A 2 Safari: Version: 6.2.3
If you wanted to display the full output for Safari, you could use
-A 8
to get the following eight lines, instead of
-A 2
.
$ system_profiler SPApplicationsDataType | grep "Safari:" -A 8 Safari: Version: 6.2.3 Last Modified: 4/6/15 2:00 PM Kind: Intel 64-Bit (Intel): Yes App Store: No Get Info String: 6.2.3, Copyright © 2003-2014 Apple Inc. Location: /Applications/Safari.app
Filtering the output of the system_profiler
command with
grep
can be used to determine the version of many applications.
E.g., if Microsoft Excel for Mac is installed:
$ system_profiler SPApplicationsDataType | grep "Excel:" -A 8 Microsoft Excel: Version: 12.3.1 Last Modified: 9/23/11 6:41 PM Kind: Universal 64-Bit (Intel): No App Store: No Get Info String: 12.3.1 (110725), © 2007 Microsoft Corporation. All rights reserved. Location: /Applications/Microsoft Office 2008/Microsoft Excel.app -- Open XML for Excel: Version: 12.3.1 Last Modified: 9/23/11 6:41 PM Kind: PowerPC 64-Bit (Intel): No App Store: No Get Info String: 12.3.1 (110725), © 2007 Microsoft Corporation. All rights reserved. Location: /Library/Application Support/Microsoft/Office Converter Support/Open XML for Excel.app
You can also check the version number for applications by looking in
the version.plist
file for an application, such as
Microsoft Excel for Mac 2011, as explained at
Extracting numbers from a
text string with grep.
References: