Skip to content

Instantly share code, notes, and snippets.

@kathawala
Created January 17, 2015 20:41
Show Gist options
  • Save kathawala/43d44a3b13e841e00b65 to your computer and use it in GitHub Desktop.
Save kathawala/43d44a3b13e841e00b65 to your computer and use it in GitHub Desktop.
Prints out a list of all pacman packages sorted by size from largest to smallest
#!/bin/bash
( echo "PACKAGE SIZE(K)";
for A in /var/lib/pacman/local/*/desc; do
egrep -A1 '%(NAME|SIZE)' $A \
| gawk '/^[a-z]/ { printf "%s ", $1 }; /^[0-9]/ { printf "%.0f\n", $1/1024 }'
done | sort -nrk2 ) | column -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment