View Single Post
Old 07-01-2016, 06:24 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Should be simple bash.

Code:
for i in /mnt/us/documents/*.sdr; do
    if [[ ! -f "${i%.sdr}.azw3" ]] && [[ ! -f "${i%.sdr}.azw" ]] && \
            [[ ! -f "${i%.sdr}.mobi" ]] && [[ ! -f "${i%.sdr}.kfx" ]]; then
        rm -rf "$i"
    fi
done
...

Though really, it doesn't matter as they aren't very big and won't save much space at all.
eschwartz is offline   Reply With Quote