Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    secure delete of trash files


    i have an issue due to some high security requirements. what i want to do is to remove the files in trash folder permanently from the memory so that they cannot be recovered again.

    i am aware of the "shred" command but i dont know if it can reach to files that are already in trash.

    I have found a solution but it requires to fill the whole unused memory with a file that consist of some ramdom bits and than deletes it:

    dd if=/dev/zero of=zero.small.file bs=1024 count=102400
    shred -z zero.small.file
    cat /dev/zero > zero.file
    rm zero.small.file
    shred -z zero.file
    rm zero.file

    my aim is to do a similar thing but only on the files that are deleted via righclicking and are seen on the trash bin.

    any suggestions?

    thx in advance.

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Boston, MA
    Shred should work fine on your trash files.

    But you should note that shred may not work in log structured or journaled filesystems where they are set to journal data. (Which is not usually the default, but still.)

    shred invocation - GNU Coreutils

    More info on how ext3 filesystems work and recovering data.
    HOWTO undelete removed files and directories on an ext3 file system

    You should also use encryption.

  3. #3
    I am a little bit suspicious if shred would do the job, cos' I do not know how actually the file system works.

    How can I list and reach the files in Trash? That is something like to tell shred command to overwrite a file which is already deleted. Do have very little Linux knowledge so I do not know how to reach the files that are listed in Trash folder.

  4. $spacer_open
  5. #4
    Linux Guru gogalthorp's Avatar
    Join Date
    Oct 2006
    West (by God) Virginia
    Each user has there own trash folder


    note there are then two sub-folders files and info that actually hold the data

  6. #5
    The problem is that all files are on your hard disk, and in a binary form.
    Meaning 0 (zero) and 1 (one).
    And if you want the file deleted, you need to overwrite it with data 0 or 1.
    There are several tools available to do this, and they are called file-wipe tools.
    They are also available for linux.

    But you could do it also by yourself.
    Use a hex-editor, and you can look at every kind of file.
    You can see the file as hexadecimal value (but also other).
    Because using binary 0 and 1 would be unpractical.
    You can fill the file with any value you want and save it, but with no back-up of course.
    It is essentially the same thing file-wipe tools are doing.

    In KDE you have KHexEdit, and if it isn't installed, it should be in kdeutils3-extra-3.5.5-34, if I remember well.
    It is a very usefull tool for doing anything.

  7. #6
    Just Joined! gnuuser's Avatar
    Join Date
    Nov 2009
    northwestern Pa, usa
    is correct shred works very good and you should use encryption
    I use a reversed alpha numeric code with a rotating cypher for encryption (this equates to 36 to the 35th power number of possible combinations) (I could change encryption codes every day and never run out of combinations)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts