A few words of thanks would be greatly appreciated.

Ubuntu - Preventing recovery of deleted files

Purpose of this tip

Here below is a simple method, on how preventing the recovery of deleted files:
  • First, make sure the recycle bin of Nautilus (the file browser) is empty.
  • Right click on it and choose the option Empty Recylcle bin

Note that: If you have other partitions (FAT, NTFS ...), each of them has its own recycle bin and this manipulation will not be applicable tothem

To view these hidden files press (CTRL + H) and look at the root of each partition the directory for the .Trash ou .Trash-nameofpartition folders and delete the files.

Crushing the free space

  • To avoid the recovery of deleted files, use the secure-delete package .
    • Installation:
      sudo aptitude install secure-delete 
    • Command:
      sudo sfill -l -l -v / 
  • For a more effective results use the command:
    sudo sfill -v / 

Important notes

  • For certain file systems (such as ext3), it is impossible to guarantee a permanent deletion.
  • Programs are included with secure-delete: srm (deleting a file), smem (erasing the memory), sswap (erasing the swap file).
  • For a file to be never written unencrypted disk, you can use encrypted file systems like TrueCrypt.

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.


This document, titled « Ubuntu - Preventing recovery of deleted files », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).