Skip to content

Instantly share code, notes, and snippets.

@fffonion
Created February 19, 2017 21:09
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 fffonion/a42f8612b4a76e7ecc0adafddbce27cb to your computer and use it in GitHub Desktop.
Save fffonion/a42f8612b4a76e7ecc0adafddbce27cb to your computer and use it in GitHub Desktop.
Purge orphan .sdr directory in Kindle
#!/bin/bash
IFS=$'\r\n'
for i in $(ls -1| grep "\.sdr"); do
f="${i%.*}"
if [[ $(ls -1| grep "$f"| wc -l) -eq 1 ]]; then
echo $i
rm -rf "$i"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment