Skip to content

Instantly share code, notes, and snippets.

@ozh
Last active August 24, 2025 15:51
Show Gist options
  • Save ozh/4968d6054b5ca83ec0e2d385c7edc51e to your computer and use it in GitHub Desktop.
Save ozh/4968d6054b5ca83ec0e2d385c7edc51e to your computer and use it in GitHub Desktop.
Remove read books on kobo reader from the command line

Shell in the kobo, from the root :

sqlite3 -header .kobo/KoboReader.sqlite "SELECT ContentID FROM content WHERE BookTitle is null and ReadStatus = 2 ORDER BY Title;" | grep epub | sed 's!file:///mnt/onboard/!!' | while read f; do rm -f "$f"; done

@ozh
Copy link
Author

ozh commented Jul 12, 2022

To list before removal :

sqlite3 -header .kobo/KoboReader.sqlite "SELECT ContentID FROM content WHERE BookTitle is null and ReadStatus = 2 ORDER BY Title;" | grep epub | sed 's!file:///mnt/onboard/!!' | while read f; do echo "-> $f"; done

@ozh
Copy link
Author

ozh commented Aug 24, 2025

Using an online SQLite viewer like https://inloop.github.io/sqlite-viewer/ : list all read books

SELECT 
    Title,
    Attribution as Auteur,
    DateLastRead as DateTermine,
    ___PercentRead as PourcentageLu
FROM content 
WHERE ContentType = '6' 
    AND ReadStatus = 2  -- Terminé
    AND Title IS NOT NULL
    AND Title != ''
ORDER BY DateLastRead DESC;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment