Jul 31, 2017

How to Delete File Permanently in Linux

Normally, we use the rm command to delete files from a Linux system, however, these files do not completely get deleted, they are simply stored and hidden on the hard disk and can still be recovered these files in Linux and viewed by another person.

To prevent this, we can use the shred command which overwrites the file content and optionally deletes the file as well.
$ shred -zvu tecmint.pdf
The options used in the above command:
  1. -z – adds a final overwrite with zeros to hide shredding.
  2. -u – helps to truncate and remove file after overwriting.
  3. -v – shows progress.