Skip to content

Instantly share code, notes, and snippets.

@ntessore
Last active August 17, 2018 14:01
Show Gist options
  • Save ntessore/b98fc9f7aedf1ea9a345 to your computer and use it in GitHub Desktop.
Save ntessore/b98fc9f7aedf1ea9a345 to your computer and use it in GitHub Desktop.
homebrew: list "unneccessary" installed packages (i.e. not needed by any other package)
#!/bin/bash
####
# list "unneccessary" installed packages (i.e. not needed by any other package)
#
# save: $ curl -Lo /usr/local/bin/brew-unnecessary https://git.io/brew-unnecessary
# chmod: $ chmod +x /usr/local/bin/brew-unnecessary
# run: $ brew unnecessary
####
for pkg in $(brew list); do
if [ -z "$(HOMEBREW_NO_AUTO_UPDATE=1 brew uses --installed --skip-build $pkg 2> /dev/null)" ]; then
echo $pkg
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment