Created
August 6, 2011 14:05
-
-
Save tmhedberg/1129359 to your computer and use it in GitHub Desktop.
Display the number of cached versions for each package in the pacman cache
This file contains hidden or 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
| #!/bin/bash | |
| ls /var/cache/pacman/pkg | | |
| awk -F - ' | |
| { | |
| k = "" | |
| for (i = 1; i < NF - 2; ++i) | |
| k = k $i "-" | |
| sub(/-$/, "", k) | |
| ++sum[k] | |
| } | |
| END { | |
| for (k in sum) | |
| print k, sum[k] | |
| } | |
| ' | | |
| sort -rk 2 | | |
| column -t | | |
| less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment