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.
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
update packages
brew list
: show installed packagesbrew update
andbrew upgrade
:brew update
updates Homebrew itself whilebrew upgrade
will upgrade your Homebrew-installed software to their latest versions. In a default configuration,brew update
will automatically run prior tobrew 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: