Last active
January 29, 2017 21:42
-
-
Save smj10j/7b11b5284e8e36f0bf2b817901e1f46e to your computer and use it in GitHub Desktop.
List all packages on an Ubuntu system sorted by size they take up on disk
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
#!/usr/bin/env bash | |
# List all packages on an Ubuntu system sorted by size they take up on disk | |
sudo dpkg-query --list | awk '{print $2}' | xargs -I% -n1 dpkg-query --status % 2>/dev/null | egrep 'Package: |Installed-Size:' | sed '$!N;s/\n/\t/' | head -n 100 | sort -r -n -k4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment