How to *really* remove a file?

Ralf Mardorf kde.lists at yahoo.com
Thu Jan 5 11:58:35 UTC 2023


The command "lsof" shows opened files.
If the "mv" command moves something on the same partition, it does
nothing with the file or it's location on the partition.
The "cp -ai" command makes a duplicated file, on another location, even
on the same partition. You can try a "cp"-"shred (the original file)"-
"mv (to rename the copied file)"-dance. However, doing something with an
opened, more or less "locked" file is idiotic.
Btw. broadly speaking, even if a file is not in use and even if you run
the "shred" command instead of the "rm" command, the file most of the
times is not "really" deleted, but this is a topic on its own, since it
depends on the file system as well as on the firmware of the drive. OTOH
you can't rely on this fact, if you hope to recover a "lost" file.





More information about the ubuntu-users mailing list