Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Clean up stale .sdr files from Kindle (paperwhite)
#!/bin/sh
# Call this from your 'documents' directory
set -eu
for d in *.sdr
do
if [ -d "$d" -a ! -n "$(find . -maxdepth 1 -type f -name "${d%.sdr}*" -print -quit)" ]
then
echo "$d"
rm -rf "$d"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.