aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-06-11 11:41:49 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-06-11 11:41:49 +0200
commitcc85b11ebd8e1fed3127506d65448296c754279e (patch)
treed9a936d4b9b45ac2d35073921555d60c7291c7e4
parent10884179618481b67240c3a9710d8cd6c2c6b9c3 (diff)
downloadscripts-cc85b11ebd8e1fed3127506d65448296c754279e.tar.gz
scripts-cc85b11ebd8e1fed3127506d65448296c754279e.zip
Created programSizes.sh to get sizes of installed programs.
-rwxr-xr-xprogramSizes.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/programSizes.sh b/programSizes.sh
new file mode 100755
index 0000000..f892497
--- /dev/null
+++ b/programSizes.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# programSizes.sh
+#
+# Outputs the sizes of programs installed by pacman ordered by size.
+
+for program in $(pacman -Q | cut -d' ' -f1); do
+ pacman -Qi "$program" | grep -E '(^Name|^Installed Size)'
+done |
+ sed '/^Name/{
+ N
+ s/Name\s*: //
+ s/\nInstalled Size\s*://
+ s/\([0-9]\) \([^0-9]\)/\1\2/
+ s/\([^ ]* \)\(.*\)/\2 \1/}' |
+ sort -h
+