#!/bin/sh # should shred already deleted files on most filesystems without too # much trouble. this gets around the traditional limitations of shred # for files you want to delete on more modern/exoctic filesystems. # havent tried this on zfs or the like, but should even work there. # thanks to the z option passed to shred will also make that volume # compress well. # its harsh on magnetic storage (like hard disks) so you probably dont # want to do this too often on your laptop. # some filesysytems (like ext2) reserve some space for root. if you # want to be extra paranoid, run this as root to make sure you wipe # that too. also see http://dban.sf.net if [ -d $1 ];then cd $1 fi dd if=/dev/zero of=.shredme case `uname` in *BSD) rm -P .shredme ;; Darwin) srm .shredme ;; *) if which shred;then shred -vz .shredme rm .shredme else echo you need the shred command to run this. echo deleting the shred file... rm .shredme fi esac