This will overwrite all partitions, master boot records, and data. Filling the disk with all zeros.
WARNING: might take a long time depending on disk size
sudo dd if=/dev/zero of=<disk/partition> bs=1M
If you are wiping your hard drive for security, you should populate it with random data rather than zeros.
WARNING: might take a long time depending on disk size
sudo dd if=/dev/urandom of=<disk/partition> bs=1M
To provide a nifty progress bar:
pv -ptres "Size of disk in gigabytes followed by a G" /dev/urandom | sudo dd of=/dev/sda bs=1M
Shred the given file/partition/disk by overwriting it first with random data and then with 0x00 (zeros).
WARNING: might take a long time depending on disk size
$ sudo shred -vfz -n 1 /dev/sdb
shred: /dev/sdb: pass 1/2 (random)...
shred: /dev/sdb: pass 1/2 (random)...514MiB/1.9TiB 0%
shred: /dev/sdb: pass 1/2 (random)...1.0GiB/1.9TiB 0%
shred: /dev/sdb: pass 1/2 (random)...1.6GiB/1.9TiB 0%
shred: /dev/sdb: pass 1/2 (random)...2.2GiB/1.9TiB 0%
...