Howto free disk space

These are some tips in addressing the dreadful recurring problem: the hard disk is full, and I need a way to understand which files to delete and to make space.

Find large files

It is quite useless to wander randomly around the directory tree and delete some files that alltogether free some few meager megabytes; it would be better to understand who is sucking our precious gigabytes all at once.
This command is your friend, type it in a terminal:
 # du -x /the/path | sort -nr | less -S
it will list the directories inside /the/path in decreasing order of aggregate disk usage. (For your home directory, use ~/ as /the/path). "Aggregate" means that, for each directory, the number reflects the space used by all files and subdirectories therein contained. Similarly the command
 # du -xS /the/path | sort -nr | less -S
lists directories sizes (that is, the total size of files contained in each directory) without summing in the sizes of subdirectories.
Look into the list, (scroll it with arrow keys, hit "q" to exit); the above listings may highlight that there are some old files that you downloaded long ago (say, an Ubuntu iso image...) and that you can delete right away.

Freeing space in the home account

In particular, for the home filesystem, there are some things that you may delete right away: The above methods may give back some hundreds megabytes.

Reduce reserved block count

Modern filesystems reserve a part of the disk space for the superuser. While this is a good idea for the root filesystem, it quite useless for data-only filesystems. So if you have such filesystems, (e.g. if your /home directory tree is all in its own partition - and I would always recommend that), you can use that extra space by setting the reserved number of blocks to 0. For ext2 ext3 and ext4 filesystem types, the command
 # tune2fs -r 0 /dev/---- 
achieves the feat (substitute /dev/---- by the correct device ; you can use mount to find out).

Freeing space in the root filesystem

In Debian/Ubuntu, there are some specific methods.