brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: brew leaves lists the Homebrew packages you actually chose to install

macOS
~/tips/tip-macos-brew-leaves-installed-by-you

brew leaves

Lists installed formulae that no other installed formula or cask depends on.

brew list on an older Mac is a wall of libraries I never asked for. A shorter list answers the real question, which is what I installed on purpose.

brew leaves
brew leaves --installed-on-request

The Homebrew manual describes leaves as listing installed formulae that are not dependencies of another installed formula or cask. Add --installed-on-request (short form -r) to keep only the ones that were installed manually. There is also --installed-as-dependency (-p) for the leaves that came along as dependencies.

It pairs well with two other commands from the same manual. brew autoremove uninstalls formulae that were only installed as a dependency and are no longer needed, and it has a dry-run flag, so look first:

brew autoremove --dry-run

And brew bundle dump writes everything installed, casks and taps included, into a Brewfile, a snapshot you can keep in version control.

The caveat is that a leaf is not the same as something you want to keep. A formula that nothing depends on may still be a tool you use daily, and a package you installed yourself can disappear from the leaves list once something else depends on it. Treat the output as a shortlist to read, never as a list to delete.

Further reading: Homebrew manpage

More macOS tips System Settings > Accessibility > Hover Text > When using the pointer A Smart Folder in Notes collects notes by tag, checklist or date Type # in a Mac note to tag it, then filter by tag in the sidebar tmutil isexcluded ~/Projects/app/node_modules Crop an image in Preview by dragging a frame and clicking Crop All macOS tips (99) All topics

Link