I've got a large zip file that I am using Terminal to unzip, like so:

unzip /Volumes/9.25.17\ Backup/Documents.zip -d /Users/evan/Desktop/

When I try this, everything works fine until it tries to extract a particular mp4 file. It gets hung up on this one file every time:

inflating: /Users/evan/Desktop/Documents/Creativity/Rotblatt copy.mp4  error:  zipfile read error

I don't really care about this file - is there any way to tell terminal to ignore it while unzipping?

  • Try with the -x "copy.mp4" – George Udosen Sep 29 '17 at 15:25
  • I've tried using -x followed by just about every possible iteration of the filename but it still tries to read it – adustybowler Sep 29 '17 at 15:29
  • Try unzip /Volumes/9.25.17\ Backup/Documents.zip -x "copy.mp4" -d /Users/evan/Desktop/ – George Udosen Sep 29 '17 at 15:32
  • Yes, I've tried that. Does more of the file path need to be included? – adustybowler Sep 29 '17 at 15:34
  • yes it has to be included addind an answer now – George Udosen Sep 29 '17 at 15:35

It's not that the file "copy.mp4" is corrupted, it is that the zip file itself has some damage.

You can attempt to fix the zip file:

zip -F /Volumes/9.25.17\ Backup/Documents.zip --out newfile.zip

and then attempt to extract the files from newfile.zip. If this does not work, you can attempt a more comprehensive fix:

zip -FF /Volumes/9.25.17\ Backup/Documents.zip --out newfile.zip

  • -F doesn't work. -FF gives: zip I/O error: Read-only file system – adustybowler Sep 29 '17 at 15:51
  • @EvanOlawsky You will need to run the command in a file system to which you have write permissions... I updated the command (I forgot the --out modifier) – Charles Green Sep 29 '17 at 15:55
  • Yes, I included the --out modifier. What do you mean about a file system where I have write permissions? – adustybowler Sep 29 '17 at 15:56
  • 1
    The "I/O error: Read-only file system" would seem to indicate that you do not have write permissions – Charles Green Sep 29 '17 at 15:58
  • 1
    Can you copy the entire zip file to your home directory and perform the operation from there? – Charles Green Sep 29 '17 at 16:47
  1. Find the absolute path to the file with:

    unzip -l /Volumes/9.25.17\ Backup/Documents.zip | grep copy.mp4
  2. Then do:

    unzip /Volumes/9.25.17\ Backup/Documents.zip -x "/path/to/file/from/step/1/copy.mp4" -d /Users/evan/Desktop/
  • This works (the process ignores the file I want it to), but it turns out there are more files that it gets hung up on too. – adustybowler Sep 29 '17 at 15:52
  • Sounds as if the problem is a corrupt zip file. – Panther Sep 29 '17 at 15:57
  • @EvanOlawsky then it appears that it didn't download completely – George Udosen Sep 29 '17 at 16:17

I had similar problem due to power failure when recording some data and directly passing it to zip. The zip file was missing the ending. zip -F or zip -FF did not solve the problem. Finally I found solution, that allowed to save most of the file:

jar xvf Document.zip

The last part of corrupted file was still lost, but it was good enough for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.