Last Updated: February 25, 2016
·
338
· hoffoo

Securely delete files Linux

Say you have a virtual machine and you want to delete files using shred. The problem here is shred is designed to be ran on a whole partition (thus removing journal data as well) and your VM may not be setup that way if you want to clear /home.

find /home/ -type f -exec shred {} \;

This will only delete (and overwrite) files, the directory structure will be preserved. Its not a bulletproof way, but it may be good enough if you just want to delete stuff quickly.