{"id":201,"date":"2009-02-12T06:59:10","date_gmt":"2009-02-12T11:59:10","guid":{"rendered":"http:\/\/installingcats.com\/?p=201"},"modified":"2009-02-12T06:59:10","modified_gmt":"2009-02-12T11:59:10","slug":"secure-delete-files-in-terminal-on-os-x","status":"publish","type":"post","link":"https:\/\/installingcats.com\/2009\/02\/12\/secure-delete-files-in-terminal-on-os-x\/","title":{"rendered":"Secure Delete Files in Terminal on OS X"},"content":{"rendered":"
Securely delete files on Mac OS X in the Terminal by using srm<\/strong>:<\/p>\n This will delete the file, then rewrite random data over the spot on the hard disk where the file was previous stored several times to prevent any file recovery attempts.<\/p>\n A regular delete using rm<\/strong> in the Terminal will only remove any pointers to the file itself, but this information can be recovered using file recovery and undelete tools.\u00a0 This is similar to erasing an entry in the telephone book for someone’s house and phone number; the house is still standing and telephone number is still valid.\u00a0 Using srm<\/strong> would send a bulldozer to the house to tear it down and break it into bits so small, it would be difficult to tell that a house ever stood there.<\/p>\n Securely deleting files is useful when you need to destroy a password file.\u00a0 For example, I keep a file that is pgp encrypted with all my passwords within it.\u00a0 When I need to add new passwords, I decrypt the file, add the new username\/passwords, then re-encrypt the file.\u00a0 Afterwards, I need to securely destroy the text file that I updated.\u00a0 For that, I use srm<\/strong>.<\/p>\nsrm <filename><\/pre>\n