Skip to content

Instantly share code, notes, and snippets.

@ryo1kato
Created January 1, 2014 04:23
Show Gist options
  • Select an option

  • Save ryo1kato/8205056 to your computer and use it in GitHub Desktop.

Select an option

Save ryo1kato/8205056 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# print list of Debian/Ubuntu packages sorted in installed-size.
#
dpkg --get-selections |
awk '{print $1}' |
xargs apt-cache show |
egrep '^(Package|Installed-Size): ' |
tr '\n' ',' |
sed -e 's/,*Package: /\n/g' -e 's/,*Installed-Size: /,/g' |
sort -t, -k2 -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment