wipe free space

Just some interesting code to remember

The Issue

To resell a notebook without reinstalling it, i needed a way to wipe the empty space on the disk after deleting all my personal data.

My Solution

This works on Linux, Mac or git bash on Windows. It creates a temporary file of zeros and deletes it when done.

cat /dev/zero > zero.file; sync; rm -f zero.file
comments powered by Disqus