A brief introduction of Homebrew common commands

A brief introduction of Homebrew common commands

search packages

  • brew search: list a lot of packages that we can install.
  • brew search | wc -l: list the number of packages.
  • brew search [keywords]: search packages use keywords.
    • Formulae deals with command line softwares.
    • Casks is an extension of homebrew that allows us to install applications such as Chrome.
    • brew_search

You can also search packages by click the link: https://formulae.brew.sh/formula/.

install/uninstall packages

Take tree as an example:

  • brew install tree
  • brew uninstall tree
  • tree_command

update packages

  • brew list: show installed packages

  • brew update and brew upgrade: brew update updates Homebrew itself while brew upgrade will upgrade your Homebrew-installed software to their latest versions. In a default configuration, brew update will automatically run prior to brew upgrade.

    • brew_upgrade
  • brew cleanup: brew does not uninstall the old-version packages, brew cleanup cam remove all of the older version of installed packages.

brew cask

So far we have installed some command line tools. But we can actually install Mac applications using brew cask(from the core homebrew repositories). For example, if we want to install pycharm:

brew cask install pycharm

And you can check the information of pycharm by typing brew cask info pycharm. In addition, you can use brew cask home pycharm to open the webpage of pycharm.

If you want to install a package which is not in core homebrew repositories, you should tap the repository first:

tap_repo