You are not logged in.
I needed to find out how much disk space do my installed packages use so I could uninstall those which take a lot of space but in fact I don't need them anymore. The shell script just parses pacman's output thus it is relatively slow. I may add functions like sorting by size or displaying sizes in MiB instead of Bytes.
for package in `pacman -Q|awk '{ print $1}'`; do pacman -Qi $package|grep -e Name -e Size|awk '{print $3}'|awk '{getline s; print $0 " " s;}'; done
The output format is very simple:
a2ps 2650067
a52dec 126230
abiword 11195890
acl 314972
acpid 71548
alsa-lib 1569288
Maybe completely rewriting it to directly parse 'desc' files in /var/lib/pacman/local would be better, I'll consider using C or python instead.
Suggestions?
Offline
Ooooh, sounds (and looks) neat. Although there might be discrepancies between the size reported in the pacman database and the actual size. Not sure about that, though.
A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.
Offline
You could probably speed things up a tad by using 'cut' instead of 'awk'
Offline
And perhaps make it display in kb? Although that's a simple matter.
I'd like to see the total size, too :-)
Offline
Great, your script is much faster than mine
. I knew I had to do this by reading desc files directly but I did not find enough time to do it.
+1
Would having pacsize sorting by size be feasable ?
Seeded last month: Arch 50 gig, derivatives 1 gig
Desktop @3.3GHz 8 gig RAM, linux-ck
laptop #1 Atom 2 gig RAM, Arch linux stock i686 (6H w/ 6yrs old battery ) #2: ARM Tegra K1, 4 gig RAM, ChrOS
Atom Z520 2 gig RAM, OMV (Debian 7) kernel 3.16 bpo on SDHC | PGP Key: 0xFF0157D9
Offline