create new partition table, format then mount the partition, change dir to your device (eg: /mnt/mountpoint)! sudo dd if=/dev/zero of=nullfile
#or /dev/random
delete the file and repeat x times!
Many newer BIOS has options to safely shred devices
SSD are difficult to erase. It is not enought to overwrite sections.
info of your device
unmounted:
smartctl -a /dev/sdg
there are also packages doing this:
shred --verbose --random-source=/dev/urandom -n1 --zero /dev/sdX
wipe -r /path/to/wipe
The KDE Partitionmanager as well as gparted now features a shred option.