Skip to content

Instantly share code, notes, and snippets.

@tcarrio
Created July 3, 2023 20:31
Show Gist options
  • Save tcarrio/5d9eeb63feaa2600931bdd5f69ad186e to your computer and use it in GitHub Desktop.
Save tcarrio/5d9eeb63feaa2600931bdd5f69ad186e to your computer and use it in GitHub Desktop.
Absolute shred all files under the current directory

shredit

Have you ever wanted something on your disk absolutely destroyed? Shredit.

#!/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