Linux and Unix shred command

Quick links

About shred
Syntax
Examples
Related commands
Linux and Unix main page

About shred

Delete a file securely, first overwriting it to hide its contents.

Syntax

shred [OPTIONS] FILE [...]

-f, --forceChange permissions to allow writing if necessary.
-n, --iterations=NOverwrite N times instead of the default (25)
-s, --size=Nshred this many bytes (suffixes like K, M, G accepted)
-u, --removetruncate and remove file after overwriting
-v, --verboseshow progress
-x, --exactdo not round file sizes up to the next full block; this is the default for non-regular files
-z, --zeroadd a final overwrite with zeros to hide shredding
-shred standard output
--helpdisplay this help and exit
--versionoutput version information and exit

Examples

shred myfile.txt

Permanently deleted and makes the file myfile.txt unrecoverable (unless stored elsewhere or on a backup).

Related commands

rm