Have you ever wanted something on your disk absolutely destroyed? Shredit.
Created
July 3, 2023 20:31
-
-
Save tcarrio/5d9eeb63feaa2600931bdd5f69ad186e to your computer and use it in GitHub Desktop.
Absolute shred all files under the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
function shredit() { | |
max_iterations=${1:-100} | |
target_dir=${2:-.} | |
for i in {0..$max_iterations} | |
do | |
printf "Wipe iteration ... %5d\n" "$((i + 1))" | |
find "$target_dir" -type f | while read f | |
do | |
shred -f "$f" | |
done | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment