Ubuntu: How To Delete Your Files (Or Wipe Your Hard Drive) Beyond Recovery

How confident are you that when you ‘delete’ a file, it really get deleted/removed/erased/wiped from your hard disk?

The fact is, the ‘delete’ command does not remove your file(s). It simply tells your system to free up the space for other data. Until the space been filled with new data, your file(s) will still remain on the disk itself. That is to say, with some simple recovery tools, the files can be easily recovered. Now, if you want to completely eradicate porns files that contain sensitive information, you have to do more than just ‘delete’ and ‘empty trash’

Shred is a shell command that allows you to securely erase any files. It overwrites the specified file(s) repeatedly, in order to make it harder for even very expensive hardware probing to recover the data.

Shred is included in many Linux distributions, thus you can use it immediately, without any further installation.

To shred a file,

shred -f -v -z -u file.txt

where

-f: change permissions to allow writing if necessary
-v: verbose, to display the progress
-z: add a final overwrite with zeros to hide shredding
-u: truncate and remove file after overwriting

ubuntu shred screenshot1

ubuntu shred screenshot2

You can type shred –help (with two ‘-’ in front of the help) to display a list of options.

Adding shred to Nautilus menu

You can also add shred to your nautilus menu for convenience sake.

1. Install nautilus-actions from your Synaptic Package Manager, or in the terminal, type

sudo apt-get install nautilus-actions

2. Open up Nautilus Actions Configuration (System->Preference->Nautilus Actions Configuration)

3. Click Add

ubuntu shred screenshot3

4. Fill in the following details:

Label: Shred
Tooltip: Use the shred utility to securely erase files
Icon: gtk-dialog-warning
Path: shred
Parameters: -f -u -v -z %M

5. Click on the Conditions tab

ubuntu shred screenshot4

6. Under the “Appears if selection contains“, check “both”

7. Check the box “Appears if selection has multiple files or folders“. Click OK

8. Open up a terminal, type

nautilus -q

nautilus

Now right click on any files, you should be able to see the shred command in the menu.

PS: While this is a useful tool to erase files, it is not guaranteed to be effective in the following conditions:

  • log-structured or journaled file systems, such as XFS and Ext3
  • file systems that write redundant data and carry on even if some writes
  • fail, such as RAID-based file systems
  • file systems that make snapshots, such as Network Appliance’s NFS server
  • file systems that cache in temporary locations, such as NFS version 3 clients
  • compressed file systems



Print this pageSave as PDF

Damien Oh is the owner and chief editor of Make Tech Easier
  • Pingback: Linux: 6 Useful Extensions to Improve Nautilus Functionality | MakeUseOf.com

  • Pingback: Linux: 6 Useful Extensions to Improve Nautilus Functionality | Evilpig's Domain

  • neil watson

    as a poor old duffer i would like to know how to delete compress files in a language i understand

    • http://maketecheasier.com/ Damien

      When you say compress files, do you mean those zipped or tar files? If you just want to delete them, you can easily do so by selecting them, right click and select Move to Trash

  • http://? neil watson

    as a poor old duffer i would like to know how to delete compress files in a language i understand

    • http://maketecheasier.com Damien

      When you say compress files, do you mean those zipped or tar files? If you just want to delete them, you can easily do so by selecting them, right click and select Move to Trash

  • Charles

    Seems to work well enough.

  • Charles

    Seems to work well enough.

  • jemdaddy

    hey guys, i got a new asus pro50gl lappy and it had vista on it, i want to put XP on there but it wont let me when i go into BIOS ect, change to first boot bla bla when it loads blue screen and says ” stating windows set up ” it comes to a blue screen saying ” we have detected a problem bl bla” how do i completely wipe the drive so i can start fresh

    • http://maketecheasier.com/ Damien

      There are several software out there that allow you to wipe your hard drive, but the one that I recommend is Gparted – http://gparted.sourceforge.net/.

      Alternatively, you can download a Ubuntu LiveCD, boot it and fix your hard drive from there.

  • jemdaddy

    hey guys, i got a new asus pro50gl lappy and it had vista on it, i want to put XP on there but it wont let me when i go into BIOS ect, change to first boot bla bla when it loads blue screen and says ” stating windows set up ” it comes to a blue screen saying ” we have detected a problem bl bla” how do i completely wipe the drive so i can start fresh

    • http://maketecheasier.com Damien

      There are several software out there that allow you to wipe your hard drive, but the one that I recommend is Gparted – http://gparted.sourceforge.net/.

      Alternatively, you can download a Ubuntu LiveCD, boot it and fix your hard drive from there.

  • nellli

    It works just perfectly!
    Thanks

  • http://- nellli

    It works just perfectly!
    Thanks

  • Pingback: Borrado seguro de archivos con Nautilus « Gnometips