Skip to content

Instantly share code, notes, and snippets.

@piotrkochan
Created April 10, 2026 23:11
Show Gist options
  • Select an option

  • Save piotrkochan/ab3d07b6c8d1dfb19549a09dde039030 to your computer and use it in GitHub Desktop.

Select an option

Save piotrkochan/ab3d07b6c8d1dfb19549a09dde039030 to your computer and use it in GitHub Desktop.
KDE Dolphin secure delete context menu (like windows s-delete)

Secure delete (shred) context menu for KDE Dolphin.

Recursively shreds files in directories.

Configurable number of overwrite passes (default 3).

Install shred-secure to ~/.local/bin/, shred.desktop to ~/.local/share/kio/servicemenus/. Both need chmod +x. Requires konsole and coreutils (shred).

Usage: right-click any file or directory in Dolphin -> "Secure delete (shred)". Just be careful - it doesnt't ask, it just fires away!

#!/bin/bash
set -euo pipefail
passes="${1:-3}"
target="$2"
if [[ -d "$target" ]]; then
find "$target" -type f | while read -r f; do
shred -n"$passes" -zu "$f" && echo "Deleted: $f"
done
rm -rf "$target" && echo "Deleted dir: $target"
else
shred -n"$passes" -zu "$target" && echo "Deleted: $target"
fi
echo "Done."
read -rsn1
[Desktop Entry]
Type=Service
MimeType=all/all
Actions=shred
[Desktop Action shred]
Name=Secure delete (shred)
Icon=edit-delete
Exec=konsole -e shred-secure 3 '%f'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment