Skip to content

Instantly share code, notes, and snippets.

@snarlysodboxer
Last active June 19, 2020 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snarlysodboxer/5732045 to your computer and use it in GitHub Desktop.
Save snarlysodboxer/5732045 to your computer and use it in GitHub Desktop.
Write zeros over all of the free space on your disk. Afterwards, remove a small file before removing the big file to help the system be more responsive in the meantime.
#!/bin/sh
dd if=/dev/zero of=$HOME/zero.small.file iflag=nocache oflag=direct bs=1024 count=102400
dd if=/dev/zero of=$HOME/zero.file iflag=nocache oflag=direct bs=4096
rm $HOME/zero.small.file
rm $HOME/zero.file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment