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 bundle dump writes your whole Homebrew setup to one Brewfile from the terminal

Terminal
~/tips/tip-terminal-brew-bundle-dump

brew bundle dump --file=~/dotfiles/Brewfile

Saves every formula, cask and tap you have, ready to install on another Mac.

Setting up a new Mac means remembering every tool you installed over the years. Homebrew can write that list for you, in a format it can install from.

Dump what is installed into a Brewfile:

brew bundle dump --file=~/dotfiles/Brewfile

The file is readable, one line per item: tap, brew, cask and, if you use it, mas for App Store apps. A dotfiles repo is a good home for it, I think, and you can edit out the experiments you no longer want.

On the new machine, install everything in one go:

brew bundle install --file=~/dotfiles/Brewfile
brew bundle check --file=~/dotfiles/Brewfile

check tells you whether something from the file is still missing, which is handy after a partial run.

Be careful with its cousin brew bundle cleanup. It uninstalls everything that is not in the Brewfile, so an old file can remove tools you installed since. It asks before it acts, but with --force it doesn’t, so never put that version in a script you haven’t read. And a dump is a snapshot: install something next week and the file doesn’t know, so run the dump again before you rely on it. If a file with that name already exists, dump refuses until you add --force.

Further reading: Homebrew Bundle and Brewfile (Homebrew docs), brew manpage (Homebrew docs)

More Terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac mc hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}' All Terminal tips (116) All topics

Link