How to Permanently Delete Files in Linux

Written by kristen waters
  • Share
  • Tweet
  • Share
  • Email

The rm command is the normal way to delete files on the Linux operating system. The rm command only removes the operating system's link to the file. You can use special tools to recover the file, sometimes even after it has been written over. The shred, srm and wipe commands can be used to delete the file so that it cannot be recovered. These commands write over the file numerous times before completely deleting the file. Each command uses a different method to write over the data. Employ the wipe command on any magnetic media.

Skill level:
Easy

Other People Are Reading

Instructions

    Shred

  1. 1

    Click on the distribution's main applications menu.

  2. 2

    Click on the "Terminal" or "Konsole" menu option to open a terminal window and access the command prompt.

  3. 3

    Type the command "shred -u -z -n 20 filename" to write random ones and zeros over the file 20 times, then write zeros over the entire file and finally delete the file. Replace "filename" with the name of the file that you want to delete.

    Srm

  1. 1

    Click on the distribution's main applications menu.

  2. 2

    Click on the "Terminal" or "Konsole" menu option to open a terminal window and access the command prompt.

  3. 3

    Download and install the secure-delete package from the distribution's software repository. Ubuntu and Linux Mint users type "sudo apt-get install secure-delete" to install the tools. Fedora and CentOS users type "yum install secure-delete" to install the tools.

  4. 4

    Type the command "srm filename" to assign a random value for the file name and overwrite the file with random data, zeros and special values to erase all evidence that the file existed. Replace "filename" with the name of the file to be deleted.

    Wipe

  1. 1

    Click on the distribution's main applications menu.

  2. 2

    Click on the "Terminal" or "Konsole" menu option to open a terminal window and access the command prompt.

  3. 3

    Download and install the wipe package from the distribution's software repository. Ubuntu and Linux Mint users type "sudo apt-get install wipe" to install the package. Fedora and CentOS users type "yum install wipe" to install the package.

  4. 4

    Type the command "wipe -dkx filename" to completely remove the file from the disk. Replace "filename" with the name of the file to be deleted.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.