Sunday, 7 August 2011

Deleting Directories Securely

The shred command is a great way of deleting individual files securely, but it can be a bit cumbersome if you have a lot of files that you want to delete at once. Fortunately, there is a secure method of deleting whole directories in Linux using the command line and a package called (appropriately enough), secure-delete.

You can install secure-delete from the Ubuntu Software Centre or the Synaptic Package Manager. The package contains tools to delete files & directories (srm), clean the swap memory (sswap), and clean the RAM (smem) - all of these tools are accessed via a terminal.

To delete a whole directory, open a terminal and type:

srm -r -v /path/to/directory

The -r option makes the process recursive (it deletes all sub-directories - so be careful!) and the -v option provides verbose output in the terminal window during the operation.

Clearly, this can save you a lot of time (and typing), but, as with all things Linux, there is an implicit assumption that you know what you are doing - once you have shredded files & directories using these tools, they cannot be retrieved.

Sources & References:

No comments:

Post a Comment