Last active
June 12, 2024 13:30
-
-
Save eguven/23d8c9fc78856bd20f65f8bcf03e691b to your computer and use it in GitHub Desktop.
List all packages installed using Homebrew and their sizes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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
Thanks @redspot I've added an alternative using
du -sch