Read more

Securely remove files on Linux

Thomas Eisenbarth
February 18, 2011Software engineer at makandra GmbH

When you delete a file with rm it's still possible to recover the file or parts of it. Use shred to overwrite the content of a file and delete it afterwards.

shred -u $file
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Be aware that this is not sufficient for flash memory, like SSDs or USB pen drives. The write will possibly target another memory area than where the file was located previously. Prefer disk encryption whenever possible.

Erasing directories

To erase complete directory structures, using shred is cumbersome. Use wipe instead:

wipe -r directory

The above warning for flash drives applies for wipe as well.

Posted by Thomas Eisenbarth to makandra dev (2011-02-18 18:02)