I've always wondered if cutting & pasting / removing the file from an OS would be the equivalent of taking proper precautions when deleting a file such as using the rm -rf
command.
I DID read here: Where do files go when the rm command is issued? that IF you move it via sneakernet that all the OS does is unlink the file thus rendering it useless, the same as (to my understanding) the command rm -rf
would do.
I would just like to know, hypothetically speaking, what would be the best, most secure way of removing a file from existence? So far I can only think of shredding it via the dd
command, shredding it via bleachbit, rm -rf
ing it or as I'm super curious to know, using a USB flash drive to physically remove the file.
-f
and-r
flags torm
don't do anything special to the contents of the file. One tellsrm
not to ask for confirmation when it might otherwise do so, and the other tells it to delete the contents of any subdirectories too. – Chris Davies Dec 23 '17 at 12:08shred
from GNU coreutils that can "securely" erase a file (by overwriting them once or repeatedly, with zeros or random data and/or with particular bit patterns), they aren't effective on COW filesystems like btrfs or zfs, or on journaled filesystems, etc.shred
's man page includes a list of types of filesystems which it isn't effective on. – cas Dec 23 '17 at 13:13