Originally Posted by oneandoneis2
Lookup the "shred" application
I don't believe that shred or wipe will work on a swap partition.
If you simply use cat /dev/zero > partition then you will write one byte or one word to the swap partition.
You should use the dd command to write zeroes or random numbers to any partition or file. In your case if the swap partition is on /dev/hda2 and if it is 1 gigabyte in size then the following command will overwrite the entire paritition with random numbers.
dd if=/dev/urandom of=/dev/hda2 bs=1G count=1
You can find more information about using dd by using the man utility. Overwriting a large partition can take some time. Make sure that your disk drive active light remains on. I have seen the dd command hang while doing this sort of thing. I do this all the time. You can adjust the byte size parameter and the count parameter if your system hangs trying to do this in one gulp.
You should overwrite the partition several times to increase the efficacy of this task. You can also do the same thing with your system partition and your data partition(s). Note that you will have to boot a live cd in order to wipe your system partition.
Once you think that you have cleaned a partition you can use the Test Disk and Photo Rec utiltities available at the following web site to check your work. These probably aren't as good as using a professional disk recovery service, but they have done a good job for me. I've tested these utilities on several disks in various states of information unavailability. They won't work on a swap partition but they will work on various Linux file system partitions and NTFS and FAT partitions. If these utilities cannot recover your files then you are probably good to go.