DEV Community

Ashutosh Kumar Sinha
Ashutosh Kumar Sinha

Posted on

Homebrew Cheatsheet

homebrew-256x256.png

Homebrew

The Missing Package Manager for macOS (or Linux)

Brew Documentation - https://docs.brew.sh

Pre-requisite

First we need to install XCode command line tools, this we can do by opening a terminal and executing below command:

xcode-select --install
Enter fullscreen mode Exit fullscreen mode

Installing Homebrew

We can now install the homebrew by opening a terminal and executing below command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Verifying Homebrew Install

brew doctor
Enter fullscreen mode Exit fullscreen mode

Listing Homebrew Commands

brew commands
Enter fullscreen mode Exit fullscreen mode

Homebrew Help

brew help [COMMAND]
Enter fullscreen mode Exit fullscreen mode

List installed Formulas

brew list
Enter fullscreen mode Exit fullscreen mode

Search for a Formula

brew search tree
Enter fullscreen mode Exit fullscreen mode

Describe a Formula

brew desc tree
Enter fullscreen mode Exit fullscreen mode

Install a Formula

brew install tree
Enter fullscreen mode Exit fullscreen mode

Show Detail Information on a Formula

brew info tree
Enter fullscreen mode Exit fullscreen mode

Show a Installed Formula's Dependencies

brew deps tree
Enter fullscreen mode Exit fullscreen mode

Show the homepage of an Formula

brew home tree
Enter fullscreen mode Exit fullscreen mode

Upgrade a Particular Formula

brew upgrade tree
Enter fullscreen mode Exit fullscreen mode

Uninstall a Formula

brew uninstall tree
Enter fullscreen mode Exit fullscreen mode

Clean Old Formulas

brew cleanup
Enter fullscreen mode Exit fullscreen mode

Search for a Cask

brew cask search visual-studio-code
Enter fullscreen mode Exit fullscreen mode

Installing Desktop/GUI Application

brew cask install visual-studio-code
Enter fullscreen mode Exit fullscreen mode

Uninstalling Desktop/GUI Application

brew cask uninstall visual-studio-code
Enter fullscreen mode Exit fullscreen mode

Update Homebrew Catalog

brew update
Enter fullscreen mode Exit fullscreen mode

Upgrade Homebrew

brew upgrade
Enter fullscreen mode Exit fullscreen mode

Uninstall Homebrew

We can uninstall the homebrew by opening a terminal and executing below command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
Enter fullscreen mode Exit fullscreen mode

GUI Search Options

Screen Shot 2020-12-29 at 2.49.04 PM.png

  • Put the name of the application you are searching for in the search field, for example here we will write tree, as you type it will search and show results in a pop up

Screen Shot 2020-12-29 at 2.49.22 PM.png

  • Select the name of the application in the pop up for example here we will select tree which will show further details about tree like description, brew command to install it, its homepage, license and version information etc.

Screen Shot 2020-12-29 at 2.49.40 PM.png

Top comments (0)