Skip to content

Instantly share code, notes, and snippets.

View tzuntar's full-sized avatar

Tobija Žuntar tzuntar

  • Europe / Slovenia
  • 12:21 (UTC +02:00)
View GitHub Profile
@eguven
eguven / brew-list.sh
Last active May 20, 2025 13:33
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