Shred

From LQWiki
Jump to navigation Jump to search

shred

shred is a command for destroying data. As contrast to rm, it does not remove a file, but it overwrites the content so often that you cannot recover it. shred will probably not completely destroy the data if you are using a journalled filesystem like JFS or ext3. Also, if you have a fault tolerant RAID array, it will not shred the data in the parity block / mirror drive.

Examples:

  • shred a file
$ echo "Sensitive data" > file
$ cat file
Sensitive data
$ shred file
$ ls file
file
$ cat file
 Ò´¿(j}yãÒÒÁXp|ÄþÅJ]vìâ£íÕ!¸`ÓçÚá/é²c\§øn
                                        cí%±0zÖTt¯É
  ¤~Q£_,§Àý?ÎO|Ù{>A0æä~Ë«Á@¾p^ÈÅáÜyÌ¡èÂ$®5Í^8fµ
 
 
  4ÒWc@!-5üÁ%¨çN!"R
  Îo8{³FI¸*  \¨ç´
  àÀTÛ^
     WÑ8ÇkÇRá3¯çz\[ÔhB®ÙºÉ%lk   @°pÅ%F ¾áDcmÃïÿfG]5Ýiû²
$ rm file
shred /dev/sdx

Provided by

Most (all?) Linux distributions incorporate this from the GNU Coreutils: man page

Related Commands

  • cp - Copy files
  • mv - Moves files
  • rm - Removes files
  • mkdir - Creates a directory
  • dd - device-to-device copier
  • install - Copy and set permissions