I'm trying to see if I can learn something more about disk usage on my setup - with respect to installed packages(all). So I'm looking at the Arch Pacman Tips about maintenance. First I try :expac -HM -s %-30n %m | awk '{s+=$2} END {print s}'3785.87 (Mb)I know this is about right. Then I try:pacsysclean | awk '{s+=$1} END {print s}'151634Both commands before the pipe operator with wc -l yield the same number of packages. What is that number output by pacsysclean? Did I misuse awk in any way here? I've tried an optional assignment before the command i.e. LC_ALL=C command to make sure it wasn't related to my locale. Result is identical.
Difference in the sum of the output of pacsysclean vs. expac using awk?
pacman
No, you haven't misused awk; it is more a case of (slightly) misusing pacsysclean.expac is explicitly designed for extracting and parsing alpm data: the results you are seeing from it are accurate.pacsysclean is not really inteded to be parseable, it simply sorts packages by their installed size. As a result, the unit size changes between MiB and KiB once the package size passes that threshold, consequently awk sums the column of integers indiscriminately.Stick with expac for parsing and pacsysclean for a quick sort.