Shred – Permanently Delete Files In Ubuntu Linux
In case you want to delete some confidential data from your computer just to make sure that it is no longer accessible to anyone, then do not delete the file using the regular rm command because there will still remain a chance that someone might use a software to recover your deleted data before the specific storage area is overwritten by new data. The proper way to permanently dispose of such data in Linux is the shred command.
Usually People who access their Linux systems via GUI, delete files by right clicking the file and choosing Delete, and the people who work on Linux from the command line use the rm command to delete the file/folder. But whatever method you follow, your data is still open to the vulnerabilities as mentioned above.
Shred is a command line utility(it is present by default in the system)which lets you delete files in such a way that it becomes almost impossible for some one to recover. Command line users always type the following command to delete any file.
rm file1 file2
Now instead of the above command, run Shred as:
shred file1 file2
Or if you wish to delete all the data on your whole drive then run the following command with the necessary modification (The only modification will be, instead of hda1 type the name of your disk here).
shred /dev/hda1
That’s it. Enjoy!