Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnmendonca/db7ae0c2164c4ee23bf3c1931bb7a205 to your computer and use it in GitHub Desktop.
Save johnmendonca/db7ae0c2164c4ee23bf3c1931bb7a205 to your computer and use it in GitHub Desktop.
# https://stackoverflow.com/questions/26365529/easiest-way-to-overwrite-a-series-of-files-with-zeros
for f in $(<list_of_files.txt)
do
read blocks blocksize < <(stat -c "%b %B" ${f})
dd if=/dev/urandom bs=${blocksize} count=${blocks} of=${f} conv=notrunc
rm ${f}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment