How to erase hard drives (shred, dd)

You could write zeros to the whole hard drive

dd if=/dev/zero of=/dev/hda

For newer versions of dd, you can monitor the progress:

dd if=/dev/zero of=/dev/hda status=progress

However, it has been recommended to write a few passes of random noise (n = 3 is the default). If the writing process entirely got rid of the magnetic history and your source of randomness was perfect, a single pass would ALWAYS be enough. In reality, you only need n>1 if you are dealing with the state secrets since recovering anything after an n=1 erase requires special equipment which you cannot buy in any store.

shred -vfz -n3 /dev/hda