Forrest logo
back to the shred tool

shred:tldr:2b05b

shred: Overwrite a file and remove it.
$ shred --remove ${filename}
try on your machine

The command shred --remove ${filename} is used to securely delete and remove a specified file.

Here's a breakdown of the command:

  • shred: The shred command is a utility available in Unix-based systems that overwrites and deletes files securely, making the original file content irrecoverable.
  • --remove: This option is used with shred to remove the file after the specified number of file overwriting operations is performed. It ensures that the file is securely deleted from the storage device. Without this option, the file would still exist on the disk, but its content would be overwritten.
  • ${filename}: This is a placeholder for the actual file name. You need to replace ${filename} with the name of the file you want to shred and remove. Make sure to provide the correct file path if the file is not in the current working directory.

In summary, executing shred --remove ${filename} will overwrite the content of the specified file with random data multiple times to ensure its secure deletion, and then remove the file from the storage device.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the shred tool