🍺 Helpful Brew commands

March 08, 2019

Compiling a list of helpful resources and cheatsheets so I no longer need to hunt them down.

Getting Started

Paste the command below in your macOS Terminal.

🍺 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Basic Usage

🍺 brew <command> <-flags>
| COMMAND                   | DESCRIPTION                                                                         |
| ------------------------- | ----------------------------------------------------------------------------------- |
| `install`                 | Install formula                                                                     |
| `uninstall / rm / remove` | Uninstall formula                                                                   |
| `reinstall`               | Uninstall and then install formula                                                  |
| `update`                  | Fetch the newest version of Homebrew and all formulae                               |
| `upgrade`                 | Upgrade outdated, unpinned brews                                                    |
| `search`                  | Display all locally available formulae for brewing                                  |
| `list / ls`               | List all files in the Homebrew prefix not installed by Homebrew                     |
| `prune`                   | Remove dead symlinks from the Homebrew prefix                                       |
| `cleanup`                 | For all installed or specific formulae, remove any older versions from the cellar   |
| `doctor`                  | Check your system for potential problems                                            |
| `tap`                     | Migrate tapped formulae from symlink-based to directory-based structure             |
| `unlink`                  | Remove symlinks for formula from the Homebrew prefix                                |

Helpful scripts and combinations

Great for global cleanup and updates

🍺 brew upgrade && brew update && brew cleanup  "Updates all brew and cask packages and remove old versions in cache"

Resources used from