MacOS – How to find all files of a specific type that are outside of a folder

applicationsmacosmojavesearch

I want to find all .app files on my Mac that aren't in the Applications folder. How do I do this?


Please unmark as duplicate

1st point: The suggested dupe's answer explains how to get a list of all applications installed, but does not explain how to exclude the Applications folder.

  1. How do I find all files of a specific type that are outside of a folder?
  2. I want to find all .app files on my Mac that aren't in the Applications folder. How do I do this?

2nd point: This is a 2-part question. The 1st part is a generic question that asks how to find ANY files of a certain kind not in a folder. The 2nd part is the situation specific to myself. The suggested dupe partially solves my own problem but doens't address the generic question.

https://meta.stackexchange.com/questions/217115

3rd point: Furthermore, a key word in this question is "find." The suggested dupe's answer works to get a list of all installations, but it's not possible to get to where they're stored on the disk.

Best Answer

Basically you take the list of applications found and filter out those who are in /Applications:

find / -type d -iname *.app | grep -v '^/Applications' > ~/applications.txt

The more elaborated way skips /Applications from the start and just lists .apps found in other directories:

find / -type d \( \( -depth 1 -name Applications -prune \) -o -name '*.app' -print \)

In both cases you might get warning messages if find tries to descend into a directory not accessible to the current user. You can prevent this by running the command with sudo.