Ubuntu / Linux news and application reviews.

When you delete a file, you are not really deleting it from your had drive. All the system does if free up the space occupied by that file to make room for other files and until that space is filled with new data, the files you tried to delete are actually still stored on your hard disk and can be recovered.

In this article, I am going to tell you how to delete files for ever (almost) in Nautilus using a command-line tool and also, how to add this functionality to Nautilus, when right clicking a file / folder. First, I would like to thank Gnome Tips for their Shred article.

Using Shred from a terminal

Shred is a command line utility used for secure delete and what it does is overwrite the files several times so that recovery of those files becomes very difficult.

To delete a file from a terminal, use the following command:

shred -f -v -z -u file_to_delete.zip


-f : changes the permissions to allow writing if necessary
-v : to show the progress
-z : add trailing zeros to hide shredding
-u : remove the file after overwriting

Adding Shred to Nautilus context menu

To add Shred to Nautilus context menu, so that you can simply right click any file / folder and select "Shred" to securely delete those files, we first need to install Nautilus-actions:
sudo apt-get install nautilus-actions

Then, go to System -> Preferences -> Nautilus Actions Configuration and click "Add" and fill in the Name, Tooltip and Icon fields as you wish. Here are mine:

nautilus actions

Now, select the "Main" profile and click "Edit" and:

Image and video hosting by TinyPic

-in the "Path" field, enter: shred
-in the "Parameters" field, enter: -f -u -v -z %M

Then, on the "Conditions" tab, under "Appears if selection contains" select "Both", and also check the "Appears if selection has multiple files or folders" box:

Image and video hosting by TinyPic

Click "OK". We are now finished with this.

Now, we must restart Nautilus. Open a terminal and paste this:
nautilus -q

Then start Nautilus by pressing ALT + F2 and entering: