Is it possible to and how do I get a list of all the packages installed on my Mac using Homebrew? I am not interested in packages installed outside of Homebrew.


brew list and brew list --cask

Running brew list will show a list of all your installed Homebrew packages.

In addition, brew list --cask will provide the items installed using Homebrew Cask.

brew list

| improve this answer | |
  • 2
    If you had this list in a txt file. How would you go about installing all of them? brew install < list.txt doesn't seem to work. – Jonathan Nov 4 '14 at 14:19
  • 34
    @Jonathan xargs brew install < list.txt Feel free to ask a separate question for more details or clarification. – grg Nov 4 '14 at 19:33
  • 3
    @grgarside - love ur terminal prompt. would you be willing to share your config files for getting my prompt to look like that? – Kaushik Gopal Dec 9 '14 at 20:21
  • 2
    @Kaushik I've finally written a blog post about my terminal/shell setup—feel free to ask any questions there. – grg Dec 14 '14 at 12:56
  • 1
    @Jonathan brew install $(< list.txt ) – phil pirozhkov Aug 7 '16 at 9:59

brew leaves shows you all top-level packages. That is packages that are not dependencies. This should be the most interesting if you are using the list to re-install packages.

| improve this answer | |
  • 8
    Nice answer. Do you know how to get a list of the packages that were installed by the user? This can be different to leaves. – Steven Shaw Jun 30 '15 at 3:02
  • 7
    Yeah, e.g java is not listed in leaves because it's a dependency to another project even though I installed it myself. – Saad Malik Jun 15 '19 at 22:13
  • bro! thank you.. – Mert A. Oct 7 at 6:35

brew bundle may also be interesting if you are asking because you want to manage your brew installation. This includes casks, which brew list does not. It is aimed at having reproducible Homebrew setups.

# creates Brewfile in the current directory from currently-installed packages
brew bundle dump
# edit Brewfile
# install everything from the Brewfile
brew bundle

You can use the --global flag to operate on your ~/.Brewfile and -f/--force to force overwriting of your existing file (for installation, this will force uninstallation of not-listed packages).

| improve this answer | |
  • This is excellent! I had no idea this existed. Thank you. I only wish it was like brew leaves and omitted the packages you didn't install directly, but only got as dependencies. In the future a package may change dependencies, but you will install it anyway and not need it. – Bruno Bronosky Dec 1 '16 at 3:34
  • 1
    Yes. It seems like every package manager goes through this phase of not differentiating the two. – Sam Brightman Dec 1 '16 at 7:30
  • 6
    A recent dump of mine suggests that bundle now excludes dependencies. There are some other changes like quote style and ordering that are making it harder to understand the diff, but overall it looks like at least some libraries are missing from Brewfile but installed. – Sam Brightman May 16 '17 at 5:04

Executing brew list command shows a simple, alphabetically sorted list of all the installed packages.

However, various required packages (dependencies) get automatically installed when installing a package using Homebrew. It is possible to view the list of all the installed packages as a nicely formatted dependency tree. To view it, execute the following command:

brew deps --tree --installed

An example output is as shown below:



├── gdbm
├── openssl
├── readline
├── sqlite
│   └── readline
└── xz


└── readline


The independently listed packages (e.g. gdbm and openssl in the example output above) have no dependencies. The packages depicted as part of a tree structure have their dependency listed at immediate lower level (e.g. package sqlite requires that the package readline to be installed). The packages listed at leaf nodes in the tree structures have no dependencies.

Dependencies visualised in a tree structure can help in easily getting rid of the unnecessary packages.

| improve this answer | |
  • 2
    The brew leaves command mentioned above is useful in this regard; it lists only the top-level packages. – Paul Bissex Jan 29 '19 at 17:46

You may use brew list | grep 'package-name' or if are looking for specific package.
brew list 'package-name' also works and provides additional information.

| improve this answer | |

To see brew packages :

brew list

To see cask packages :

brew list --cask

To see upgradable brew packages :

brew outdated

To see upgradable cask packages

brew outdated --cask
| improve this answer | |
  • I've rolled back your edit, code and shell commands are easier to read with code formatting. – nohillside Aug 18 at 7:30

You can use this snippet to list all installed packages and sort them by their size.

| improve this answer | |

Others have mentioned brew leaves, which lists things that aren't dependencies; and brew deps --tree --installed which lists the dependency tree for all installed packages.

I find the most useful output of any answers yet is the combination of these.

brew deps --tree $(brew leaves)

This will list the complete tree of your brew install.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .