Skip to content

Instantly share code, notes, and snippets.

@hazcod
Last active April 6, 2022 03:06
Show Gist options
  • Save hazcod/fa5b9fb7cfcde52e76c76a2413bb7570 to your computer and use it in GitHub Desktop.
Save hazcod/fa5b9fb7cfcde52e76c76a2413bb7570 to your computer and use it in GitHub Desktop.
List all top level brew packages
#!/usr/bin/env bash
#EDIT: just use `brew leaves`
brew deps --installed | awk -F'[: ]+' '{
packages[$1]++
for (i = 2; i <= NF; i++)
dependencies[$i]++
}
END {
for (package in packages)
if (!(package in dependencies))
print package
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment