title_body: How to repack an epub file from command line
upvoted_answer: zip -rX ../my.epub mimetype META-INF/ OEBPS/
  
  
  
  
  Without -X you could get the following when validating it with EpubCheck:
  
  ERROR: my.epub: Mimetype entry must not have an extra field in its ZIP header
  
  
  If mimetype is not the first in the epub file EpubCheck prints the following:
  
  ERROR: my.epub: Mimetype entry missing or not the first in archive