This article covers how to use the shred command in Debian 10 Buster system along with various command line options.
You have seen that how the shred command overwrites and deletes the files, making them hard to recover using any recovery tools.
Shred old data files for the same reason you shred old paper documents.
Commands included in the secure-delete bundle:
1. srm is a secure rm, used to erase files by deleting them and overwriting their hard drive space.
2. sfill is a tool to overwrite all free space on your hard drive.
3. sswap is used to overwrite and cleanse your swap space.
4. sdmem is used to cleanse your RAM.
How to Shred a Single FIle ?
To shred a single file, we can use the following command.
The options we are using are:
i. u: Deallocate and remove the file after overwriting.
ii. v: Verbose option, so that shred tells us what it is doing.
iii. z: Performs a final overwrite with zeroes.
$ shred -uvz test.txt_01.txt
Here, shred overwrites the file four times by default.
The first three passes use random data, and the final pass uses zeroes, as we requested.
It then removes the file and overwrites some of the metadata in the inode.