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:
Alternatively, you can use the [.inline-code]--formula[.inline-code] flag to list the CLI packages only:
Or the [.inline-code]--cask[.inline-code] flag to list the GUI packages only,
[#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:
Which will either output the local path of the package if it is installed:
Or an error message otherwise:
[#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:
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:
Finally, to get the version numbers of a particular package, you can append the package name at the end of this command:
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: