Skip to content

Instantly share code, notes, and snippets.

@ussserrr
Last active January 9, 2021 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ussserrr/fc62f54278d50d24940646599b8b89aa to your computer and use it in GitHub Desktop.
Save ussserrr/fc62f54278d50d24940646599b8b89aa to your computer and use it in GitHub Desktop.
List installed Homebrew packages that are not being dependencies of any other
#!/bin/sh
echo "Orphaned packages:\n"
for BREW_PKG in $(brew list --formula -1)
do
BREW_USES_PKG=$(brew uses $BREW_PKG --installed --recursive)
if [ -z "$BREW_USES_PKG" ]
then
echo "$BREW_PKG"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment