Skip to content

Instantly share code, notes, and snippets.

@flyingoctopus
Forked from eguven/brew-list.sh
Created October 21, 2024 09:54
Show Gist options
  • Save flyingoctopus/9a04646b3699f7c75c56ee3744f31d4e to your computer and use it in GitHub Desktop.
Save flyingoctopus/9a04646b3699f7c75c56ee3744f31d4e to your computer and use it in GitHub Desktop.
List all packages installed using Homebrew and their sizes
# this original one uses values returned from 'brew info'
brew list --formula | xargs -n1 -P8 -I {} \
sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \
sort -h -r -k2 - | column -t
# faster alternative using 'du'
du -sch $(brew --cellar)/*/* | sed "s|$(brew --cellar)/\([^/]*\)/.*|\1|" | sort -k1h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment