Get the size of each installed formula in homebrew?

I am doing some cleanup of packages that are no longer needed, and I want to figure out how to do this with homebrew. It will also be useful to find out if any package depends on another package that I plan to remove.

+4
source share
2 answers

It is not very beautiful, but you can do

$ brew list | xargs brew info

And he will bring something along the lines

...
/usr/local/Cellar/ant/1.9.6 (1,611 files, 34.8M)
  Poured from bottle on 2016-03-31 at 09:35:41
/usr/local/Cellar/ant/1.9.7 (1,611 files, 34.9M) *
  Poured from bottle on 2016-12-15 at 09:58:56
..

for each package you install. I'm sure some kind of grep wizard can make you give you a nice table if you have many taps installed.

+4
source

This shell snippet from https://gist.github.com/eguven/23d8c9fc78856bd20f65f8bcf03e691b will help you

for pkg in `brew list -f1 | egrep -v '\.|\.\.'`
  do echo $pkg `brew info $pkg | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/\1/'`
done
+1
source

Source: https://habr.com/ru/post/1657888/


All Articles