I was using shred to get rid of some files and I noticed that it did the following:

shred: 0000: renamed to 000
shred: 000: renamed to 00
shred: 00: renamed to 0

Does anyone know what's the point in renaming file to 000... etc?

  • 2
    Have you Googled this? "shred: 0000: renamed to 000" returns a lot of results explaining why they do it. – schroeder Nov 16 '15 at 22:48
  • 1
    @schroeder Including this very question as #1. – Damian Yerrick Jan 16 '16 at 4:47

After shred has finished overwriting the data of your file, (and assuming you used the -u flag to remove the file) it renames the file multiple times in order to also overwrite the filesystem record, removing metadata and all traces that the file existed.

Of course the success of the shred command depends on filesystem implementation, some newer journaling filesystems do not overwrite data in place; see details here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.