User Tools

Site Tools


howtos:securely_delete_files_and_folders_in_nautilus

Getting a wipe action in the menu

Adding wipe to your Nautilus context menu is useful in making it so that you can securely delete any number of files and/or folders at one time simply by selecting them, right clicking, and clicking wipe. Before you can add wipe to the context menu you must have nautilus-actions and wipe installed. To install them on a Debian based system, at the terminal, simply type:

  sudo apt-get install wipe
  sudo apt-get install nautilus-actions

When you install nautilus-actions a GUI based tool will be installed to allow you configure context menu additions. Access it by, at the terminal, typing: nautilus-actions-config

Adding the wipe command to the context menu is now very straight forward. The following instructions were written for nautilus-actions 1.4.1:

  1. Click the +Add button.
  2. For the label enter: Wipe.
  3. For the tooltip enter: Use the wipe utility to securely delete the file(s)/folder(s).
  4. For the path enter: wipe
  5. For the parameters enter: -rf %M
  6. Go to the Conditions tab and select the radio button labeled "Both" for when the command should appear and check "Appears if select has multiple files or folders"
  7. I left everything else at their defaults. If you don't want to do any further customization just hit OK and close the configuration tool.

8. You can select an icon, I prefer the gtk-dialog-warning icon. The parameters to wipe, -rf %M, causes files and folders to be deleted without prompting. Due to the -r command, if there are files or subfolders in a selected folder they will also be wiped. If you would like for files to be wiped even when write permission is not set change the parameters to: -rcf %M.

The final step is to reset nautilus. At the terminal type:

  nautilus -q
  nautilus

You will now have a command for wipe in your Nautilus context menu that allows you to securely delete any number of files and/or folders in two clicks.

Using a script with output

The above wipe action doesn't tell you anything on how progress is going and wiping a lot of file on a usb stick take a while.

Therefor this little tweak to show what is going on and as an added bonus it also ask you before trashing your important files :-D.

Start out by making a file called “wiper.sh”:

#!/bin/sh
file=$1

$(zenity --title="Wipe $file" --question --text="Are you sure?")
if [ $? -eq 0 ]
then
	gnome-terminal -e "wipe -qQ10 -rfi $file"
	exit 0
 else
	exit 0
 fi
fi

Make it executable:

chmod +x wiper.sh

Change the settings for the wipe action in nautilus-action-config:

And bounce Nautilus:

nautilus -q

Source: http://www.ubuntu-unleashed.com/2008/01/securely-wipeerase-files-in-ubuntu.html

howtos/securely_delete_files_and_folders_in_nautilus.txt · Last modified: d/m/Y H:i by 127.0.0.1