Terminus
List Installed Packages With Brew

List Installed Packages With Brew

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
 /usr/local/Cellar/tree/2.0.4/bin/tree
 /usr/local/Cellar/tree/2.0.4/share/man/man1/tree.1

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