0

I am very new to Macs however I did hear that there was a Bash script that can be utilized to check to see if certain applications were installed on a machine

closed as unclear what you're asking by IconDaemon, Allan, fsb, Ɱark Ƭ, Nimesh Neema Jan 10 at 4:03

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What's the question? – Allan Jan 9 at 20:07
  • sorry, im looking for a script to see if I can pull a list in terminal that can check to see if certain applications were installed rather than going into applications and looking one by one – Arealh1 Jan 9 at 20:12
  • 1
    As written, it's still too broad. For example, you can issue the command sudo find / -name *.app to find all Apps on any system, however, that doesn't include binaries (like ffmpeg) that may have been downloaded manually. What specifically, are you looking to do? – Allan Jan 9 at 20:20
  • When we image machines we install a list of application, some are inhouse some are public such as Chrome At the end of the imaging process we have to manually see if all the application installed successfully What im hoping for is a script that can list the applications and verify if it was installed or not to save time – Arealh1 Jan 9 at 20:40
  • How are you doing this now? – Allan Jan 9 at 20:54
1

There are several ways via the command line to look to see if an Application is installed:

View the Applications Directory

  • To list all Applications installed system wide:

    $ ls /Applications                    
    
  • To list Applications installed by/for a specific user:

    $ ls /Users/<username>/Applications  
    

Query system_profiler

The following command will list every single Application installed on the system that's in the Applications database:

$ system_profiler SPApplicationsDataType

It lists everything including obscure apps/utilities installed by Apple (or 3rd parties) that was included with the macOS installation. Using grep we can limit it to a particular application.

$ system_profiler SPApplicationsDataType | grep -i Excel
    Microsoft Excel:
      Location: /Applications/Microsoft Excel.app

The caveat with these is that it must have been "properly" installed and registered with the system. If you happen to download a binary directly from a website (ffmpeg is an excellent example), it won't show up using any of these methods.

Use which or type

For binaries that weren't installed, but rather just downloaded or copied onto a system and assuming they are in the path, you can use the command which or type

$ which ffmpeg
/usr/local/bin/ffmpeg

$ type ffmpeg
ffmpeg is /usr/local/bin/ffmpeg

Not the answer you're looking for? Browse other questions tagged .