1

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 -rfing it or as I'm super curious to know, using a USB flash drive to physically remove the file.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
  • 1
    How is this question different to the one asked in your link? – Chris Davies Dec 23 '17 at 12:06
  • Bear in mind that the -f and -r flags to rm don't do anything special to the contents of the file. One tells rm 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:08
  • Because while they mentioned how rm works, they didn't directly ask nor answer what happens to a file when it's removed from it's original system onto a peripheral. I'd like to know some detail as to what's left behind if anything even is left behind & if there is what can be done with that data? – Diprotic Dec 23 '17 at 12:09
  • And the other question's answer seems to address that quite clearly. (Last but one sentence in the answer.) Or maybe you didn't realise the same rule applies? - it does. – Chris Davies Dec 23 '17 at 12:10
  • I guess I just wanted to know if there is anything special in a way a file is treated when moved onto a peripheral (cut/paste) vs just being removed via the rm command. – Diprotic Dec 23 '17 at 12:12
  • Ah ok. "No" :-) – Chris Davies Dec 23 '17 at 12:13
  • Wow lol okay well, I just wanted to clarify that for myself, thanks roaima. – Diprotic Dec 23 '17 at 12:14
  • There are several programs like shred 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

0 Answers0