List Installed Packages With Brew

Last Updated on 2023-04-25

Last Updated on 2023-04-07

Razvan Ludosanu
Founder, learnbackend.dev

The short answer

To get a list of all the CLI and GUI packages installed with Homebrew, you can use the following [.inline-code]brew[.inline-code] command:

 $ brew list

Alternatively, you can use the [.inline-code]--formula[.inline-code] flag to list the CLI packages only:

 $ brew list --formula

Or the [.inline-code]--cask[.inline-code] flag to list the GUI packages only,

 $ brew list --cask

[#check-installed-package]Checking an installed package[#check-installed-package]

To check whether a particular package is already installed, you can append the package name to the [.inline-code]brew list[.inline-code] command as follows:

 $ brew list <package>

Which will either output the local path of the package if it is installed:

 $ brew list tree

Or an error message otherwise:

 $ brew list awf
 Error: No such keg: /usr/local/Cellar/awf

[#easily-recall-syntax]Remind yourself of the syntax using AI Command Search[#easily-recall-syntax]

If you’re using Warp as your terminal, you can easily retrieve this command using the Warp AI Command Search feature:

Entering [.inline-code]verify vim installed with brew[.inline-code] in the AI Command Search prompt results in [.inline-code]brew list vim[.inline-code], which you can then quickly insert into your shell by doing [.inline-code]CMD+ENTER[.inline-code].

[#installed-package-versions]List the versions of installed packages[#installed-package-versions]

Since Homebrew allows you to install and manage multiple versions of a package at the same time, you can use the [.inline-code]--versions[.inline-code] flag to get a list of all the installed packages including their version numbers:

 $ brew list --versions

Alternatively, you can filter out this list by only printing the list of packages with multiple versions installed using the [.inline-code]--multiple[.inline-code] flag:

 $ brew list --versions --multiple

Finally, to get the version numbers of a particular package, you can append the package name at the end of this command:

 $ brew list --versions <package>

Note that all of these above commands can be combined with the [.inline-code]--formula[.inline-code] and [.inline-code]--cask[.inline-code] flags as follows:

 $ brew list --versions --multiple --formula

Experience the power of Warp

  • Write with an IDE-style editor
  • Easily navigate through output
  • Save commands to reuse later
  • Ask Warp AI to explain or debug
  • Customize keybindings and launch configs
  • Pick from preloaded themes or design your own