Skip to content

Instantly share code, notes, and snippets.

@tjluoma
Last active May 22, 2019 12:54
Show Gist options
  • Save tjluoma/93c625cf860a0153019014920a0fa8d3 to your computer and use it in GitHub Desktop.
Save tjluoma/93c625cf860a0153019014920a0fa8d3 to your computer and use it in GitHub Desktop.
Generate an alphabetized list of all of the apps that are installed on your Mac which came from the Mac App Store, and open the list in a text file.
find /Applications -type d -user 0 -iname _MASReceipt -maxdepth 3 -print \
| sed 's#/Contents/_MASReceipt##g' \
| sort -f \
| open -f
@tjluoma
Copy link
Author

tjluoma commented May 22, 2019

Line 1 = look in /Applications folder for folders (-type d) which are owned by root (-user 0) with the name "_MASReceipt" (-iname _MASReceipt) which are found no more than 3 levels deep (-maxdepth 3) and show the result (-print)

That will give results that look like this:

/Applications/Microsoft Excel.app/Contents/_MASReceipt
/Applications/Microsoft OneNote.app/Contents/_MASReceipt
/Applications/Microsoft Outlook.app/Contents/_MASReceipt
/Applications/Microsoft PowerPoint.app/Contents/_MASReceipt
/Applications/Microsoft Remote Desktop.app/Contents/_MASReceipt
/Applications/Microsoft Word.app/Contents/_MASReceipt

where

  1. "/Applications/Microsoft Word.app/" is considered "1 level deep"
  2. "/Applications/Microsoft Word.app/Contents/" is considered "2 levels deep" and
  3. "/Applications/Microsoft Word.app/Contents/_MASReceipt" is considered "3 levels deep"

because find is starting from /Applications/.

Line 2 = remove the "/Contents/_MASReceipt" part of each line

LIne 3 = sort the list alphabetically while ignoring case

LIne 4 = send the output to the default text editor (probably TextEdit) and open in a temp file which you can save if you want.

If you use BBEdit you can change the last line to

| bbedit --scratchpad

to send it to BBEdit's "scratchpad" instead of TextEdit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment