Remove .DS_Store files from ePUB files


I've found that since upgrading to Lion OS X .DS_Store files have been inserting themselves into ePUBs when they are zipped, and I don't think I'm alone. To erase these use the following command from within the folder containing the ePUB (changing "filename" to the name of your file):

zip -d filename.epub `unzip -l filename.epub | grep .DS_Store | awk '{print $4}'`

The solution is essentially the one provided by Meitar Moscovitz to remove .DS_Store files from ZIP files, since ePUBs are renamed ZIP files.

Comments