Skip to content

Instantly share code, notes, and snippets.

@troyp
Forked from jamesktan/Shell Commands ePub
Created November 28, 2021 05:59
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 troyp/ccd9c165df13e0b8bc5d952fb1eadd8f to your computer and use it in GitHub Desktop.
Save troyp/ccd9c165df13e0b8bc5d952fb1eadd8f to your computer and use it in GitHub Desktop.
Unzipping & Zipping ePub from Command Line
// To unzip the epub, move the ePub to a folder, cd to it then simply:
unzip MyEbook.epub
// To zip up an epub:
1. zip -X MyNewEbook.epub mimetype
2. zip -rg MyNewEbook.epub META-INF -x \*.DS_Store
3. zip -rg MyNewEbook.epub OEBPS -x \*.DS_Store
Some explanations necessary here. We start each line with two flags:
-r (recursive)
This means move down through any directories/folders recursively, ensuring that everything in the folders specified gets included
-g (grow file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment