Skip to content

Instantly share code, notes, and snippets.

@vijinho
Created August 26, 2018 14:33
Show Gist options
  • Save vijinho/cf9f4d1009b253be5887ca0a69c102f2 to your computer and use it in GitHub Desktop.
Save vijinho/cf9f4d1009b253be5887ca0a69c102f2 to your computer and use it in GitHub Desktop.
overwrite files with random data and then remove
#!/bin/sh
files=$@
for file in $files;
do
set `du $file`;
size=$1
for times in 0 1 2;
do
dd if=/dev/urandom of=$file count=$size conv=notrunc
done
rm $file
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment