Skip to content

Instantly share code, notes, and snippets.

@martinhj
Created October 16, 2019 11:44
Show Gist options
  • Save martinhj/78dd8dee064a964db20ec703c32f3d8d to your computer and use it in GitHub Desktop.
Save martinhj/78dd8dee064a964db20ec703c32f3d8d to your computer and use it in GitHub Desktop.
safe deletion: overwrite file before deletion
dd if=/dev/zero of=filewithsecret bs=1 count=12342 conv=notrunc
# ^^^^^- filesize (ls -l filewithsecret)
# ^^^^^- notrunc: do not truncate the file if count is < filesize (do not leave secret bits and bytes hanging around on your disk....)
# Could combine this with a for loop to do it a couple of times if feeling extra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment