5

Tip #94   Overwrite a file with zeroes

Overwrites a file with zeroes.
Put in in your .bashrc or .bash_profile in Mac OS X.

zero() {

case "$1" in
"") echo "Usage: zero <file>"
return -1;
esac
filesize=`wc -c "$1" | awk '{print $1}'`
`dd if=/dev/zero of=$1 count=$filesize bs=1`
}