#!/bin/sh FS1=rootfs FS2=/dev/mmcblk0p2 for PACKAGE in $(dpkg-query -W --showformat='${Package}\n'); do PKGSIZE1=0 PKGSIZE2=0 for FILE in $(dpkg -L "${PACKAGE}"); do if [ -f "${FILE}" ]; then MPOINT=$(df "${FILE}" | tail -n 1 | awk '{print $1}') SIZE=$(du -k "${FILE}" | awk '{print $1}') if [ "$FS1" == "$MPOINT" ]; then PKGSIZE1=$(($PKGSIZE1 + $SIZE)) fi if [ "$FS2" == "$MPOINT" ]; then PKGSIZE2=$(($PKGSIZE2 + $SIZE)) fi fi done echo "$PKGSIZE1 $PKGSIZE2 ${PACKAGE}" done
# sh appspace.sh 0 1468 adblock-plus-1.0 0 60 adflashblock-css 6576 0 adobe-flashplayer 0 0 advanced-clock-plugin 28 264 advanced-interface-switcher 0 236 advanced-power-common 0 1364 aircrack-ng 128 0 alarmd
# sh appspace.sh > appspace.txt
# sort -nk1 appspace.txt .... 5304 72 nokia-maps-core 6504 0 omap3430-dsp-libraries-ti 6576 0 adobe-flashplayer 6804 0 libssl0.9.8 7812 0 kernel-power-modules 8808 0 libc6 9832 0 perl 10756 0 microb-l10n 16924 0 microb-engine 23352 0 posix-locales 34848 0 kernel-power-headers
# sort -nk2 appspace.txt ... 0 14764 python-pyside.qtgui 8 16228 mplayer 1888 17872 pingus-data 0 18116 libqt4-webkit 4 18420 phototranslator-alpha 8 20476 vim 4 21856 stellarium-mobile 2588 25264 frozen-bubble-data 12 33656 angrybirds 8 34048 njurassic 16 35556 mypaint