In this tip, we will see a very useful command line tool that will help us find out which programs and packages are taking much space on a system running Ubuntu or Debian Users of other Linux-based distributions could also use this command.

To show disk space occupied by installed programs and packages, run this command via the Terminal:

dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}' | tail -n 50

If you want to display more or less programs, then change the number following "tail -n". Here is a sample of the output I got after running the command given above:

~$ dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}' | tail -n 50
13.023 MB iso-codes
13.551 MB gnome-icon-theme
13.578 MB gok
13.828 MB gedit-common
14.027 MB epiphany-browser-data
14.043 MB texlive-metapost-doc
14.328 MB libgs8
14.484 MB libwebkit-1.0-2
14.520 MB gnome-panel-data
14.660 MB rhythmbox
15.484 MB perl-modules
15.590 MB python-gdata
16.012 MB texlive-binaries
16.254 MB libqt4-webkit
16.664 MB foomatic-db
17.504 MB nautilus-data
17.758 MB ekiga
17.906 MB libicu44
18.102 MB libc6-dev
18.156 MB openoffice.org-calc
18.645 MB xulrunner-1.9.1

That's it!

Post a Comment