shred

shred

The shred command is a Linux command that can be used to securely delete files. It does this by overwriting the file data with random data, making it impossible to recover the original data.

Here are some examples of how to use the shred command:

# To securely delete the file `file.txt`:
shred file.txt

# To securely delete the file `file.txt` and overwrite it 3 times:
shred -n 3 file.txt

# To securely delete the file `file.txt` and force the overwrite, even if the file is open:
shred -f file.txt

# To securely delete the file `file.txt` and zero out the file data after overwriting it:
shred -z file.txt

The shred command is a powerful tool that can be used to securely delete files. It is a simple command to use, but it can be very effective.

help

shred [options] files

Securely delete files by overwriting them multiple times.

Options:

-n, --iterations=N   overwrite each file N times (default 3)
-f, --force          force overwrite even if the file is open
-z, --zero          zero out the file data after overwriting it
-u, --unlink        unlink the file after overwriting it
-v, --verbose        print progress information
-h, --help           show this help message

For more information, see the shred man page.

breakdown

-n: This option tells shred to overwrite the file data a specified number of times. The default is 3 times.
-f: This option tells shred to force the overwrite, even if the file is open.
-z: This option tells shred to zero out the file data after overwriting it.
-u: This option tells shred to unlink the file after overwriting it.
-v: This option tells shred to print progress information.

Last updated