Homebrew Cheatsheet

Installation for MacOS


Install command-line tools if not already installed by running the following command

xcode-select --install

Note: If you have installed Xcode already then your mac already have command-line tools.

Install Homebrew

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

Installing a software

You can install brew available softwares by running the following command

brew install <software_name>


brew install mongodb

If you want to install a specific version of a sooftware, you can mention the available version name using @<version>


brew install [email protected]

Uninstalling a softwware

You can uninstall a installed software by running the following command

brew remove <software_name>


brew remove mongodb

Searching for a software

You can search available softwares by running following command

brew search <software_name>


$ brew search mongodb
==> Formulae
mongodb ✔                                [email protected]                              [email protected]
[email protected]                              [email protected]                              percona-server-mongodb

==> Casks
mongodb                                  mongodb-compass-community                mongodbpreferencepane
mongodb-compass                          mongodb-compass-isolated-edition         nosqlbooster-for-mongodb
mongodb-compass-beta                     mongodb-compass-readonly                 orelord-mongodb

Other useful commands

brew doctorself-diagnose shows if the installatin is correct or notNA
brew upgrade <software_name>To Update a installed sooftwarebrew upgrade mongodb

Uninstalling Homebrew

In case you decided to completely uninstall Homebrew from your Mac, you can run the followiong command to uninstall

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

©Copyright 2020 OneCompiler | Privacy Policy | Terms & Conditions